Newbie: what is a usefull IDE for Python on Windows ?
what is a usefull IDE for Python on Windows ? I saw Eric mentioned.. is that WinXP or Linux ? What does "everybody" use ? I was considering using old and very stable C-code in a new web application via Python/Plone/Zope. -- http://mail.python.org/mailman/listinfo/python-list
Re: Newbie: what is a usefull IDE for Python on Windows ?
btw: my system is an AMD 1.8 GHz, 512 Mbyte with WinXPSP2. I saw that a system like Wing would be sluggish ... -- http://mail.python.org/mailman/listinfo/python-list
Re: Newbie: what is a usefull IDE for Python on Windows ?
ok, thnx. Thread closed :-) -- http://mail.python.org/mailman/listinfo/python-list
Combining C and Python
I found this text about combining C-code with Pyton scripting on the P2P networks in PDF: Python Scripting for Computational Science Hans Petter Langtangen Simula Research Laboratory and Department of Informatics University of Oslo amazon and others have it in print. software for the text is here: http://folk.uio.no/hpl/scripting/ if you want to download the 1st edition from http://folk.uio.no/hpl/scripting/ the password (first word on page 92) is "leads" (no quotes) -- http://mail.python.org/mailman/listinfo/python-list
Feasible in Python ? list of object , with two exeptional objects
Is the following intuitively feasible in Python: I have an array (I come from C) of identical objects, called sections. These sections have some feature, say a length, measured in mm, which is calculated by a method A_length of the instantiation of the Section's class. Only, two elements in the array (or list ?) have a length that must be calculated according to a totally different procedure, a different function or method. After calculation of ALL the lengths, they must be added together and output. The calculation procedure screams for a FOR or a WHILE loop allong the list of sections, only those two sections mentioned make life difficult. I was thinking along the line of building a class Section, instantiate a list of objects of this class, and then replace 2 of the elements of the list by instantiations of the special class... Or maybe replace only the method in question by the special method... It would be neat, if I could just walk the FOR loop, constructing the list and calculate the total length in one go... Concretely, the situation is a Plone site that passes user "section" data to a Python / C server-side to do calculations on the section data and return the result over the web. -- http://mail.python.org/mailman/listinfo/python-list
Re: Combining C and Python
On Wed, 27 Dec 2006 16:12:02 +0100, Osiris <[EMAIL PROTECTED]> wrote: >I found this text about combining C-code with Pyton scripting on the >P2P networks in PDF: > >Python Scripting for Computational Science >Hans Petter Langtangen >Simula Research Laboratory >and >Department of Informatics >University of Oslo > > >amazon and others have it in print. >software for the text is here: >http://folk.uio.no/hpl/scripting/ > >if you want to download the 1st edition from >http://folk.uio.no/hpl/scripting/ >the password (first word on page 92) is "leads" (no quotes) > and for the second edition the password is "function" -- http://mail.python.org/mailman/listinfo/python-list
Re: Feasible in Python ? list of object , with two exeptional objects
On Wed, 27 Dec 2006 23:27:08 +0100, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote: >In <[EMAIL PROTECTED]>, Osiris wrote: > >> I have an array (I come from C) of identical objects, called sections. >> These sections have some feature, say a length, measured in mm, which >> is calculated by a method A_length of the instantiation of the >> Section's class. >> Only, two elements in the array (or list ?) have a length that must be >> calculated according to a totally different procedure, a different >> function or method. > >Is this something that the instances of section "know" or is some external >"knowledge" needed to identify those special objects? the sections know, beforehand. I can write the method NOW. > >> After calculation of ALL the lengths, they must be added together and >> output. >> The calculation procedure screams for a FOR or a WHILE loop allong the >> list of sections, only those two sections mentioned make life >> difficult. > >Sounds like something like ``sum(section.length() for section in sections)``. > >Your description is a bit vague. Where and how do you start to treat the >objects different. I create all sections, also the differeent one. I know all along which is differeent. > Is it possible to decide at instantiation time to >create a `Section` object or a `SpecialSection` object? How much YES >different is the calculation? rather al lot. > Do you need two separate classes or just >one with a flag or maybe a function as argument to the `__init__()` is differenter than that.. >method? Are you writing the `Section` class(es) just for this >calculation or do they contain other behavior too? > They have a lot of other behavior too... >Ciao, > Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list
Re: Feasible in Python ? list of object , with two exeptional objects
On Wed, 27 Dec 2006 16:29:29 -0600, "Paul McGuire" <[EMAIL PROTECTED]> wrote: >"Osiris" <[EMAIL PROTECTED]> wrote in message >news:[EMAIL PROTECTED] >> Is the following intuitively feasible in Python: >> I have an array (I come from C) of identical objects, called sections. >> These sections have some feature, say a length, measured in mm, which >> is calculated by a method A_length of the instantiation of the >> Section's class. >> Only, two elements in the array (or list ?) have a length that must be >> calculated according to a totally different procedure, a different >> function or method. >> After calculation of ALL the lengths, they must be added together and >> output. >> The calculation procedure screams for a FOR or a WHILE loop allong the >> list of sections, only those two sections mentioned make life >> difficult. >> > >Any reason you don't just use simple inheritance? > > >from random import choice >class BasicSection(object): >def __str__(self): >return "%s: %s" % (self.__class__.__name__, self.A_length()) > >class OrdinarySection(BasicSection): >def __init__(self): ># boring numbers >self.mundaneLengthValue = choice(range(10)) >def A_length(self): >return self.mundaneLengthValue > >class ExceptionalSection(BasicSection): >def __init__(self): ># exceptional numbers! >self.extraordinaryLengthValue = >choice([1.414,3.14159,2.71828,1.6180339,]) >def A_length(self): >return self.extraordinaryLengthValue > ># create list of Sections, randomly choosing Ordinary or Exceptional ones >listOfSections = [ choice( (OrdinarySection,ExceptionalSection) )() >for i in range(10) ] > ># now iterate over the list and get length for each >totalLength = 0 >for sec in listOfSections: >print "Adding length of " + str(sec) >totalLength += sec.A_length() >print "total =", totalLength > ># or more Pythonically, use a generator expression >totalLength = sum( sec.A_length() for sec in listOfSections ) >print "total =", totalLength > >One sample run gives this result (although because we randomly choose which >class to create when adding elements to the list, the results are different >every time): >Adding length of OrdinarySection: 6 >Adding length of OrdinarySection: 2 >Adding length of OrdinarySection: 0 >Adding length of OrdinarySection: 4 >Adding length of OrdinarySection: 1 >Adding length of ExceptionalSection: 3.14159 >Adding length of OrdinarySection: 4 >Adding length of ExceptionalSection: 3.14159 >Adding length of ExceptionalSection: 2.71828 >Adding length of ExceptionalSection: 1.414 >total = 27.41546 >total = 27.41546 > > >In truth, it is not even necessary for both classes to subclass from >BasicSubject (as would be the case in C++ or Java). Python's duck-typing >will take any object that implements A_length() - I just created a common >superclass to put the __str__ method in, and to more classically follow >common inheritance patterns. > >-- Paul > Thank you for your elaborate answer. This indeed gives me an idea of how it would be possible. What you say is, that I would make two entirely separate classes. Now, the classes are going to be big: lots of methods and attributes. A lot of the methods are going to be identical, only a few (crucial ones) will be special. Would I put all the stuff that is the same in both classes in the base class and only the differing stuff in the subclasses ? = class Super: # a big super class def methodA etc def methodX etc class normalSection(Super): # two small subclasses def length etc class SpecialSection(Super): def length etc. listOfSections = [normalSection,normalSection,specialSection,specialSection,normalSection] for section in ListOfSections: total += section.length() someOtherTotal += section.MethodA() === Could I move the normal length method to the superclass, and override it in the special class, like this: === class Super: # a big base class def methodA etc def methodX etc def length etc class normalSection(Super): # not needed anymore class SpecialSection(Super): # just the special stuff in here, def length etc.# overriding the base class listOfSections = [Super, Super, Super, SpecialSection, Super] == Some background: Always when I dive into a new language (after Fortran, Basic, Pascal, Forth, ASM's, C, Java(script), PHP etc.) I take a known problem/program and try to do it in the new language, so I can concen
Re: Combining C and Python
On Thu, 28 Dec 2006 08:48:53 +0100, Osiris <[EMAIL PROTECTED]> wrote: >On Wed, 27 Dec 2006 16:12:02 +0100, Osiris <[EMAIL PROTECTED]> wrote: > >>I found this text about combining C-code with Pyton scripting on the >>P2P networks in PDF: >> >>Python Scripting for Computational Science >>Hans Petter Langtangen >>Simula Research Laboratory >>and >>Department of Informatics >>University of Oslo >> >> >>amazon and others have it in print. >>software for the text is here: >>http://folk.uio.no/hpl/scripting/ >> >>if you want to download the 1st edition from >>http://folk.uio.no/hpl/scripting/ >>the password (first word on page 92) is "leads" (no quotes) >> > >and for the second edition the password is "function" oh, and the PDF password is "foo" -- http://mail.python.org/mailman/listinfo/python-list
Re: Feasible in Python ? list of object , with two exeptional objects
On Thu, 28 Dec 2006 11:14:27 +0100, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote: >In <[EMAIL PROTECTED]>, Osiris wrote: > >> Would I put all the stuff that is the same in both classes in the base >> class and only the differing stuff in the subclasses ? > >Yes that's the intent of base/sub class relationships. Baseclasses >contain the behavior common to all their subclasses and subclasses >implement just the different or additional behavior. > >> Could I move the normal length method to the superclass, and override >> it in the special class, like this: > >Yes that can be done and makes perfectly sense if the `length()` in the >baseclass is the "normal" behavior and that baseclass can be instantiated >and used directly. > >Ciao, > Marc 'BlackJack' Rintsch now we're rolling ! :-) thnx both. -- http://mail.python.org/mailman/listinfo/python-list
python , Boost and straight (but complex) C code
I have these pieces of C-code (NOT C++ !!) I want to call from Python.
I found Boost.
I have MS Visual Studio 2005 with C++.
is this the idea:
I write the following C source file:
#include
#include
namespace { // Avoid cluttering the global namespace.
int my_int; /* a global integer: or outside namespace ? */
double calc ( double f)
{
my_int = (int) (f/2);
printf( "Half of %f is %d\n", f, my_int );
return f/2;
}
}
#include
using namespace boost::python;
BOOST_PYTHON_MODULE( half )
{
def("calc", calc );
}
Which I put in a VC project and compile into a .DLL
This DLL I put somewhere on my disk, where Python 2.4 can find it.
then I write the following Python source:
=
from half import *
calc(34655.0)
et voila ?
Can I acces my_int too, this way ?
--
http://mail.python.org/mailman/listinfo/python-list
Re: python , Boost and straight (but complex) C code
I get, from Visual C++, these linker errors, 8 in total, trying to build the above C++ source: C_test.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) void __cdecl boost::python::detail::init_module(char const *,void (__cdecl*)(void))" ([EMAIL PROTECTED]@[EMAIL PROTECTED]@@[EMAIL PROTECTED]) referenced in function _inithalf C_test.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) void __cdecl boost::python::detail::scope_setattr_doc(char const *,class boost::python::api::object const &,char const *)" ([EMAIL PROTECTED]@[EMAIL PROTECTED]@@[EMAIL PROTECTED]@[EMAIL PROTECTED]@Z) referenced in function "void __cdecl boost::python::def(char const *,int (__cdecl*)(float))" ([EMAIL PROTECTED]@[EMAIL PROTECTED]@boost@@[EMAIL PROTECTED]@Z) C_test.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) class boost::python::api::object __cdecl boost::python::objects::function_object(struct boost::python::objects::py_function const &)" ([EMAIL PROTECTED]@[EMAIL PROTECTED]@@[EMAIL PROTECTED]@[EMAIL PROTECTED]@123@@Z) referenced in function "class boost::python::api::object __cdecl boost::python::detail::make_function_aux >(int (__cdecl*)(float),struct boost::python::default_call_policies const &,struct boost::mpl::vector2 const &)" ([EMAIL PROTECTED]@[EMAIL PROTECTED]@boost@@[EMAIL PROTECTED]@[EMAIL PROTECTED]@@[EMAIL PROTECTED]@boost@@[EMAIL PROTECTED]@[EMAIL PROTECTED]@[EMAIL PROTECTED]@[EMAIL PROTECTED]@[EMAIL PROTECTED]@@Z) C_test.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall boost::python::objects::py_function_impl_base::py_function_impl_base(void)" ([EMAIL PROTECTED]@[EMAIL PROTECTED]@@[EMAIL PROTECTED]) referenced in function "public: __thiscall boost::python::objects::caller_py_function_impl > >::caller_py_function_impl > >(struct boost::python::detail::caller > const &)" ([EMAIL PROTECTED]@[EMAIL PROTECTED]@[EMAIL PROTECTED]@@[EMAIL PROTECTED]@[EMAIL PROTECTED]@@[EMAIL PROTECTED]@boost@@@[EMAIL PROTECTED]@boost@@[EMAIL PROTECTED]@[EMAIL PROTECTED]@[EMAIL PROTECTED]@@[EMAIL PROTECTED]@[EMAIL PROTECTED]@@[EMAIL PROTECTED]@@Z) C_test.obj : error LNK2001: unresolved external symbol "public: virtual unsigned int __thiscall boost::python::objects::py_function_impl_base::max_arity(void)const " ([EMAIL PROTECTED]@[EMAIL PROTECTED]@boost@@UBEIXZ) C_test.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: virtual __thiscall boost::python::objects::py_function_impl_base::~py_function_impl_base(void)" ([EMAIL PROTECTED]@[EMAIL PROTECTED]@@[EMAIL PROTECTED]) referenced in function "public: virtual __thiscall boost::python::objects::caller_py_function_impl > >::~caller_py_function_impl > >(void)" ([EMAIL PROTECTED]@[EMAIL PROTECTED]@[EMAIL PROTECTED]@@[EMAIL PROTECTED]@[EMAIL PROTECTED]@@[EMAIL PROTECTED]@boost@@@[EMAIL PROTECTED]@boost@@[EMAIL PROTECTED]) C_test.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) struct boost::python::converter::rvalue_from_python_stage1_data __cdecl boost::python::converter::rvalue_from_python_stage1(struct _object *,struct boost::python::converter::registration const &)" ([EMAIL PROTECTED]@[EMAIL PROTECTED]@@[EMAIL PROTECTED]@PAU_object@@[EMAIL PROTECTED]@@Z) referenced in function "public: __thiscall boost::python::converter::arg_rvalue_from_python::arg_rvalue_from_python(struct _object *)" ([EMAIL PROTECTED]@[EMAIL PROTECTED]@boost@@[EMAIL PROTECTED]@@@Z) C_test.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) struct boost::python::converter::registration const & __cdecl boost::python::converter::registry::lookup(struct boost::python::type_info)" ([EMAIL PROTECTED]@[EMAIL PROTECTED]@boost@@[EMAIL PROTECTED]@[EMAIL PROTECTED]@@Z) referenced in function "struct boost::python::converter::registration const & __cdecl boost::python::converter::detail::registry_lookup(float const volatile & (__cdecl*)(void))" ([EMAIL PROTECTED]@[EMAIL PROTECTED]@[EMAIL PROTECTED]@@[EMAIL PROTECTED]@[EMAIL PROTECTED]) C:\Documents and Settings\Erik\My Documents\Visual Studio 2005\Projects\C_test\Debug\C_test.dll : fatal error LNK1120: 8 unresolved externals -- http://mail.python.org/mailman/listinfo/python-list
Re: python , Boost and straight (but complex) C code
Visual C++ build log at: http://213.10.133.192/BuildLog.htm -- http://mail.python.org/mailman/listinfo/python-list
Re: python , Boost and straight (but complex) C code
On Sat, 30 Dec 2006 13:19:28 -0800, Erik Max Francis <[EMAIL PROTECTED]>
wrote:
>Osiris wrote:
>
>> I have these pieces of C-code (NOT C++ !!) I want to call from Python.
>> I found Boost.
>> I have MS Visual Studio 2005 with C++.
>>
>> is this the idea:
>> I write the following C source file:
>>
>> #include
>> #include
>>
>> namespace { // Avoid cluttering the global namespace.
>
>iostream and namespaces are both most definitely C++ features, not C.
yes, but C can be compiled with a C++ compiler, One can put C code in
C++ source Boost should not complain... should it ?
Boost text is all about C++.. so... C should not be a problem...
--
http://mail.python.org/mailman/listinfo/python-list
Re: python , Boost and straight (but complex) C code
On Sun, 31 Dec 2006 01:01:29 +0100, Christophe Cavalaria
<[EMAIL PROTECTED]> wrote:
>Osiris wrote:
>
>> On Sat, 30 Dec 2006 13:19:28 -0800, Erik Max Francis <[EMAIL PROTECTED]>
>> wrote:
>>
>>>Osiris wrote:
>>>
>>>> I have these pieces of C-code (NOT C++ !!) I want to call from Python.
>>>> I found Boost.
>>>> I have MS Visual Studio 2005 with C++.
>>>>
>>>> is this the idea:
>>>> I write the following C source file:
>>>>
>>>> #include
>>>> #include
>>>>
>>>> namespace { // Avoid cluttering the global namespace.
>>>
>>>iostream and namespaces are both most definitely C++ features, not C.
>>
>> yes, but C can be compiled with a C++ compiler, One can put C code in
>> C++ source Boost should not complain... should it ?
>> Boost text is all about C++.. so... C should not be a problem...
>
>Not all C code can be compiled by a C++ compiler. And anyway, this is
>definitively NOT C code.
ok ok,
but the examples of the application of boost only show how to do C++.
So I followed those examples and try to embed my C code in the
framework of the examples...
Which seems not to be without merit, because my example here compiles
ok, but the linking into a DLL goes wrong, looking at the log.
I told VC where the boost libs are, and still
--
http://mail.python.org/mailman/listinfo/python-list
Re: python , Boost and straight (but complex) C code
On Sat, 30 Dec 2006 23:35:22 +0200, "Roman Yakovenko" <[EMAIL PROTECTED]> wrote: >On 12/30/06, Osiris <[EMAIL PROTECTED]> wrote: >> Visual C++ build log at: >> >> http://213.10.133.192/BuildLog.htm > >It is better to ask Boost.Python related questions on it mailing list: >http://mail.python.org/mailman/listinfo/c++-sig/ > >You should add to the link line boost_python.lib, thus you will eliminate >"unresolved reference symbol" errors. If you did not build Boost.Python >next page( http://boost.org/libs/python/doc/building.html ) contains pretty >good explanation how to do this. That explanation I find confusing: "To build boost_python, use Boost.Build...": Where is boost.build and what is it ? in my D:\boost\libs\python\build there is no boost.build... in D:\boost there is a build-boost.jam file Is that it ? I have a D:\boost\libs\python\build\bin-stage\boost_python.dll (204kB size) and a D:\boost\libs\python\build\bin-stage\boost_build.lib (163 KB) I made them with Visual Studio... I made a bjam, it is in C:\ In D:\boost\libs\python\build there are a bin_stage and a VisualStudio folder , the files jamfile jamfile.v2 python_v1.zip Is it so, that I can build the boost_python.dll and lib, either with bjam OR with VisualStudio C++ ? Why are all those other folders there in d:\boost ? people, regression, tools, status etc ? What do I do with d:\boost\boost ? a lot of headers there... what are all these folders in d:\boost\libs\ ? In short: it's all rather confusing I think it must be like this: To use my C/C++ code with Python, add some stuff in the C/C++ source and compile it into a DLL, that must be combined with some boost-DLL to make it accessible to Python 2.4. Therefore I need a boost DLL from boost.org, and some headerfiles that belong to the boost DLL. (where are those boost header files ) As you see, a lot of obfuscation MAybe I see too many bears on the road... > >http://boost.org/libs/python/doc/v2/scope.html - here you will find example how >to expose my_int variable to Python. my_int has type int, so C++ code will not >see changes to the variable that are done from Python. You will have to write >set_my_int( x ) function to achieve this. > >If you are new to Boost.Python try to use Py++ - the code generator for >the library. The Py++ GUI( http://tinyurl.com/ycwvwo ) will help you >to start\learn Boost.Python. -- http://mail.python.org/mailman/listinfo/python-list
BOOST again: how to proceed from here....
I'm trying to work with Boost, trying to use my C-code from Python..
So now I have generated a C_test2.dll and a C_test2.lib with Visual
C++ 2005, from code like this:
===
#include
#include
namespace { // Avoid cluttering the global namespace.
int my_int; /* a global integer: or outside namespace ? */
double calc ( double f)
{
my_int = (int) (f/2);
// printf( "Half of %f is %d\n", f, my_int );
return f/2;
}
}
#include
using namespace boost::python;
BOOST_PYTHON_MODULE( half )
{
def("calc", calc );
}
=
Now I want to use calc from Python.
I have my Python in c:\python24\ (IDLE system, version 2.4.4)
Where do I put the dll and lib ?
in c:\python24\libs and c:\python24\DLLs ?
and do I import like:
import C_test2.dll
?
because now I get this:
Traceback (most recent call last):
File "", line 1, in -toplevel-
import C_test2.dll
ImportError: DLL load failed: The specified module could not be found.
--
http://mail.python.org/mailman/listinfo/python-list
BOOST confuses me: a few assumptions: true or false.....
I read a lot of the html pages on installing boost etc. Still a lot of
confusion.
Here is what I want:
I have old, stable wonderful C-code I want to use in Python projects.
So I encapsulate the C-code in some C++ stuf and try to compile it
into a DLL.
1: I DL-ed boost_1_33_1.exe (I use WinXP) and unpacked to D:\boost
2: I started my MS Visual C++ 2005 and told the Studio that my
python2.4 includes and libs are at c:\python24\include and
c:\python24\libs
3: I found the project in D:\boost\libs\python\build\VisualStudio and
Studio converted that to the 8.0 version of my VC.
4: I compiled and got stuff in D:\boost\libs\python\build\bin-stage:
208.896 boost_python.dll
99.090 boost_python.exp
166.216 boost_python.lib
532.480 boost_python_debug.dll
99.102 boost_python_debug.exp
168.490 boost_python_debug.lib
6.450.176 boost_python_debug.pdb
(the numbers are sizes)
Am I now set up to start on my own projects ?
Do I need bjam from here on ? or can I continue to do my own projects
in VC ?
do I need all the stuff in the folders like D:\boost\libs\* (except
D:\boost\libs\python) ? they do not seem to be used till now...
here is an example of mine, to play around with:
However, I get the compile log (http://213.10.133.192/BuildLog.htm)
#include
#include
namespace { // Avoid cluttering the global namespace.
int my_int; /* a global integer: or outside namespace ? */
double calc ( double f)
{
my_int = (int) (f/2);
// printf( "Half of %f is %d\n", f, my_int );
return f/2;
}
}
#include
using namespace boost::python;
BOOST_PYTHON_MODULE( half )
{
def("calc", calc );
}
--
http://mail.python.org/mailman/listinfo/python-list
How to get BOOST working on XP and Visual C++ 2005
My experiences with BOOST on Windows XP and Visual C++ 2005 I'm new to Python. I built software in more than ten other computer languages. I'm not sure if that is not a handicap, when reading documentation of a system like BOOST. However: It took me more than four full working days to get a Python/C/C++ 'hello world!' program to work. There is a lot of documentation, but somehow it did not 'click' with my previous experience. I think the doc was written by very, very capable C++ and Python programmers, who forgot how the world was before they got involved with Python. A teacher/doc writer should never forget that, I think. Mind you: the documentation is all there. Stressing the word ALL. There is a lot of documentation. Which makes it very difficult to choose the right piece. My project is, to use old and tested and stable and error-free C-code in a website built with Zope (www.zope.org) and Plone (www.plone.org). So I think, C-code can be wrapped in some C++ and then, with the help of Boost, be called from Python. Python is important when using Plone. So let me summarize what I found out. BOOST is a system to combine Python and C++. Call C++ compiled code from Python, which is interpreted. In the end, BOOST is a sort of "make" facility like found on Linux (and Windows). In Boost it is called, not 'make.exe', but 'bjam.exe'. You define a list of operations, which bjam executes for you. It runs from the command line (I grew up, IT-wise, in the DOS-era. Hurray), it has no GUI-like Windows front-end. So the first step is to get bjam.exe from the net. There are two ways to get it: 1. download a ready-to-run bjam.exe from http://downloads.sourceforge.net/boost/boost-jam-3.1.13-1-ntx86.zip?modtime=1149717367&big_mirror=0. In the zip you will find the bjam.exe, which you put it in a place where the system can always find it, like in c:\, or somewhere else in the system's PATH. 2. download the sources for bjam.exe and build it yourself: http://downloads.sourceforge.net/boost/boost-jam-3.1.13.zip?modtime=1149717465&big_mirror=0 . I recommend not to do this, if you don't have to. And on Windows XP, you don't have to. You could spend a lot of time to figure out how to set up things before even building bjam.exe. The second step is to get Boost libraries. These are for combining with your C/C++ source, so Python can access the C/C++ code. You download this stuff from Sourceforge: http://downloads.sourceforge.net/boost/boost_1_33_1.zip?modtime=1133816391&big_mirror=0 It is a zip file that you unzip to a convenient location. I unzipped to D:\ so I got a folder named d:\boost_1_31_1 with all the stuff in it. I renamed this folder to d:\boost, to get rid of all the messy version numbers. To build the boost libraries from these sources, you need bjam, and bjam makes use of your C/C++ compiler. In my case that was Microsoft Visual C++ 2005, which has version number 8.0. Now you have to make bjam and Visual C++ acquainted with the location of supporting software. I made a BAT file to do this. This is what is in that .BAT file, named SET.BAT and which I put in D:\boost: d: cd \boost call e:\msvc\vc\vcvarsall.bat set VC80_ROOT=e:\msvc\vc set TOOLS=vc-8_0 set PYTHON_ROOT=c:\python24 set PYTHON_VERSION=2.4 I explain: e:\msvc is where I installed my Visual C++ system. The Microsoft default location would be something like C:\Microsoft Visual C 2005\ etc, but I preferred D:\msvc. Change the SET.BAT file as needed . My IDLE (http://www.python.org/idle/) Python 2.4 is in C:\python24 The value 'vc-8_0' denotes the boost identification of my MS Visual C++ system. If you use an other C++ system, it must be something else (see http://www.boost.org/more/getting_started.html) Now start a DOS box: Click the Start button in the lower left corner, click on "run" and type "cmd". There you switch to D:\ and change directory to \BOOST. Execute the SET.BAT. Then just type "bjam" (the system will find the program bjam itself, because it is in the PATH) Now get a lot of coffee, because the build will take a LONG time, maybe 15 minutes or more. You will see a lot of cpp-compiling and linking going on and some warnings about 'deprecation', which are irrelevant. When finished, keep the DOS box open. You will find BOOST stuff in C:\boost, the default location for the compiling results. Now try out an example. In the DOS box, go to D:\boost\libs\python\example\tutorial, where you find a 'hello' example and a Jamfile. Jamfile's are what a makefile is for make.: a script for bjam to build all the 'hello' stuff needed for python. Type 'bjam' again, and take a smaller amount of coffee. The system will build the 'hello' stuff for you. Do not be alarmed about bjam finding 1200+ 'targets' and rebuilding 40 of them, when only needing to compile hello.cpp . this is normal behaviour. When bjam has finished, you will find 'hello' stuff in the unbelievably deep folder D:\boost\libs\python\example\tutorial\bin\tutorial\hello.pyd\vc-8_0\debu
