» Home » Python » Page 1
How to easily distribute Python software that has Python module dependencies? Frustrations in Python package installation on Unix
by poofyhairguy in Operating Systems

My goal is to distribute a Python package that has several other widely used Python packages as dependencies. My package depends on well written, Pypi-indexed packages like pandas, scipy and numpy, and specifies in the setup.py that certain versions or higher of these are needed, e.g. "numpy >= 1.5".


I found that it's immensely frustrating and nearly impossible for Unix savvy users


how to call a python bytecode file by boost.python or by python/c api
by comphollic in Programming Languages

I have some python bytecode file as "a.pyc","b.pyc".I want to run this file in c++ code.
The code can call boost.python or python/c api.
PyEval_EvalCode?


PyObject* PyEval_EvalCode(PyCodeObject *co, PyObject *globals, PyObject *locals)

But how to get PyCodeObject from the bytecode file.


Emacs on Mac for Python - python-mode keeps using the default Python version
by Morbo in Programming Languages

how do I change the version of Python that emacs uses in the python-mode to the latest version that I just installed ?


I tried setting the PATH in my init.el file to the path where the latest version of python resides but its not working.


Problems with Python 2.7 + wxPython 2.8.11? Should I switch back to Python 2.6.5 + wx.Python 2.8.10.1?
by Philippines in Programming Languages

I'm currently using Python 2.7 + wxPython 2.8.11 on my windows machine. While trying to build a small project (which also uses comtypes and lets say any activex such as flashwindow) I'm getting the following error:


>>>"c:Program FilesPython_2.7python.exe" setup.py py2exe
running py2exe
*** searching for required modules ***
*** parsing results ***
***

Revert from Python 2.7 to Python 2.6 in Mac OSX 10.6.8 doesn't work even though I've uninstalled Python 2.7
by socurious in Programming Languages

I have mac OSX 10.6.8. My system came with Python 2.6
I recently installed Python 2.7 but experienced many problems with it so decided to revert back to Python 2.6 by executing


$ sudo rm -rf /Library/Frameworks/Python.framework/Versions/2.7

I also removed Python 2.7 from my Applications folder.


Still, however, when I run


$

Boost::Python Forward Declaration of boost::python::object throwing python TypeError
by zuz in Programming Languages

I'm trying to refactor parts of my project, particularly the Python/C++ interface.
The standard boost::python python initialization was working before:


boost::python::object main_module = boost::python::import("__main__");
boost::python::object globals(main_module.attr("__dict__"));

//...


However, after factoring that into a class of i


How to host python cgi script with `python -m SimpleHTTPServer 8000` or `python -m CGIHTTPServer 8000`?
by Jesse McDowell in Programming Languages

When I run python -m SimpleHTTPServer 8000 or python -m CGIHTTPServer 8000 in my shell I am hosting the content of my current directory to the internet.


I would like to make the following cgi_script.py work correctly using the above command in the command line when I browse to 192.xxx.x.xx:8000/cgi_script.py


#!/usr/bin/env python

Python - Calling a non python program from python?
by Jerome in Programming Languages

I am currently struggling to call a non python program from a python script.


I have a ~1000 files that when passed through this C++ program will generate ~1000 outputs. Each output file must have a distinct name.


The command I wish to run is of the form:


program_name -input -output -o1 -o2 -o3

To date I have tried:


impor

issues with Mysql python code,when restarting python script after abnormal abort
by Neuromaster in Programming Languages

I am writing python code to get movies data from dbpedia and put in MySql database.
presently, my application is having issues and it is hanging in between or if it aborts, then next time I restart, there some issues occur when droping the table and creating table in database.


Is it because last time connection with the database didnt get close?
If so then what can be poss


Python RegEx Discrepancy vs Kodos and RegExr: Can't Filter Specific Character in Python
by Thomas Gueze in Programming Languages

I'm using Python 2.6.3. When I do:


import re, urllib
f = urllib.urlopen(website)
z = f.read()
a = re.findall(r'(d*SLegos)[^/bLegos]', z)
print a

I get:


['/Legos', '/Legos', '525Legos', '53Legos', '11Legos', '8Legos', '10Legos', '2Legos', '0Legos', '0Legos', '0Legos', '0Legos', '9Legos', '1Legos', '0Legos', '0Legos', '0Leg

Next
Privacy Policy - Copyrights Notice - Feedback - Report Violation - RSS 2014 © bighow.org All Rights Reserved .