Example (cont)

Step three: Compile into a module

  • Create a file called "Setup" like this
     *shared*
     spam gcd.c spammodule.c
  • Copy the file Makefile.pre.in from the Python directory.
     % cp /usr/local/lib/python1.5/config/Makefile.pre.in . 
  • Type the following
     % make -f Makefile.pre.in boot
     % make
     
  • This will (hopefully) create a shared object file with the module
<<< O'Reilly OSCON 2000, Advanced Python Programming, Slide 122
July 17, 2000, beazley@cs.uchicago.edu
>>>