PyCXX -- README
Installation using distutils
Windows Installation and Demo
- Fetch
http://prdownloads.sourceforge.net/cxx/pycxx-6.1.1.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.1.1
C:\pycxx-6.1.1> python setup.py install
- Install the PyCXX Demo:
C:> cd \pycxx-6.1.1\Demo
C:\pycxx-6.1.1\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.1.1.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.1.1
# python setup.py install
- Install the PyCXX Demo for Python2:
# cd ~\pycxx-6.1.1\Demo\Python2
# python setup.py install
- Install the PyCXX Demo for Python3:
# cd ~\pycxx-6.1.1\Demo\Python3
# 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.1.1.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.1.1\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.1.1.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_python3_common.mak.
Revision History
Version 6.1.1 (26-Sep-2009)
Supports Python 3 starting at Python 3.1 and Python 2
Code clean up to fix compiler warnings reported by gcc 4.2.1 on Mac OS X when building for Python 3.
Version 6.1.0 (19-Jul-2009)
Support Python 3 and Python 2