» Home » Python » Page 1
How to easily distribute Python software that has Python module dependencies? Frustrations in Python package installation on Unix
Category : 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

View Replies

how to call a python bytecode file by boost.python or by python/c api
Category : 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.

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

But how to get PyCodeObject from the bytecode file.

View Replies

Problems with Python 2.7 + wxPython 2.8.11? Should I switch back to Python 2.6.5 + wx.Python
Category : 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 ***

View Replies

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
Category : 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


View Replies

Emacs on Mac for Python - python-mode keeps using the default Python version
Category : 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.

View Replies

Boost::Python Forward Declaration of boost::python::object throwing python TypeError
Category : 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

View Replies

How to host python cgi script with `python -m SimpleHTTPServer 8000` or `python -m CGIHTTPServer 8000`?
Category : 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

View Replies

Python - Calling a non python program from python?
Category : 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:


View Replies

How to create an application which embeds and runs Python code without local Python installation?
Category : Programming Languages

Hello fellow software developers.

I want to distribute a C program which is scriptable by embedding the Python interpreter.
The C program uses Py_Initialize, PyImport_Import and so on to accomplish Python embedding.

I'm looking for a solution where I distribute only the following components:

my program executable and its libraries
the Python library (d

View Replies

Python RegEx Discrepancy vs Kodos and RegExr: Can't Filter Specific Character in Python
Category : 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

View Replies

2012 / 2017 Copyrights BigHow , All Rights Reserved .