PyCXX -- README
Installation using distutils
Windows Installation and Demo
- Fetch
http://prdownloads.sourceforge.net/cxx/pycxx-6.0.0.tar.gz
- Expand the archive into a directory of your choosing C:\ for example.
Note: WinZip can expand .tar.gz files.
- Install the PyCXX files:
C:> cd \pycxx-6.0.0
C:\pycxx-6.0.0> python setup.py install
- Install the PyCXX Demo:
C:> cd \pycxx-6.0.0\Demo
C:\pycxx-6.0.0\Demo> python setup.py install
- Run the demo:
C:> python
>>> import CXX.example
>>> CXX.example.test()
>>> r = CXX.example.range( 11, 100, 13 )
>>> for i in r: print i
...
Unix Installation and Demo
Note: distutils is not available for Python 1.5.2
- Fetch
http://prdownloads.sourceforge.net/cxx/pycxx-6.0.0.tar.gz
- Login as root. root access is typically needed on Unix systems to install the PyCXX files into the Python directories.
- Expand the archive into a directory of your choosing ~\ for example.
- Install the PyCXX files:
# cd ~\pycxx-6.0.0
# python setup.py install
- Install the PyCXX Demo:
# cd ~\pycxx-6.0.0\Demo
# python setup.py install
- Run the demos:
$ python
>>> import CXX.example
>>> CXX.example.test()
>>> r = CXX.example.range( 11, 100, 13 )
>>> for i in r: print i
...
Installation using Project and Makefile
If you cannot or do not wish to use the distutils methods to work with PyCXX a set
of Makefiles and Project files are provided.
Windows Installation and Demo
- Fetch
http://prdownloads.sourceforge.net/cxx/pycxx-6.0.0.tar.gz
- Expand the archive into a directory of your choosing C:\ for example. WinZip can expand .tar.gz files.
- Build the example. Using Microsoft Visual C++ 2008 for python version 3.0 or later load the workspace
corresponsing to the version of Python you wish the work with.
- example_py30.sln - Python 3.0 and its maintanence release
- Run the example. (I'll assume you are testing Python 3.0)
- cd c:\pycxx-6.0.0\pyds30
- c:\python30\python -c "import example;example.test()"
Unix and Mac OS X Installation and Demo
- Fetch
http://prdownloads.sourceforge.net/cxx/pycxx-6.0.0.tar.gz
- Expand the archive into a directory of your choosing ~/ for example.
- Select to makefile for your system and python version.
- example_linux_py30.mak - Linux Python 3.0
- example_mac_py30.mak - Mac OS X Python 2.5
- Build the example. Use GNU make
$ make -f example-makefile example.so
- Run the examples.
$ make -f example-makefile test
To create a makefile for another vendors Unix follow these steps:
- copy one of the example make files above.
- edit the variables to match your Python installation and C++ compile needs
- Proceed to build and test as above.
Note: most of the makefile rules to build PyCXX and its example are contained in example_common.mak.
Revision History
Version 6.0.0 (31-Jan-2009)
Support Python 3.0
Support compiling sources that use the PyCXX V5.5.0 API against Python 3.
Requires compiling with PYCXX_PYTHON2TO3 defined.
Use PyCXX V5.5.0 for Python 2.
Improved documentation