define

Bengt Richter bokr at oz.net
Thu May 8 16:05:50 EDT 2003


On 8 May 2003 19:37:14 +0300, marcus at infa.abo.fi (Marcus Alanen) wrote:

>On Thu, 08 May 2003 15:10:38 +0100, Turhan Ozen <txo at cs.nott.ac.uk> wrote:
>>Could you show me a simple macro pre-processor example or a web page 
>>about it, please.
>
>Well, technically you can use any preprocessor. How suitable it is
>for Python development is another matter.
>
>Example: test.p contains:
>
>#define PH x[1]
>PH = 3
>
>Running "cpp -P test.p" produces exactly what you think it would,
>
>x[1] = 3
>
>Nothing special, no magic here. You might want to do makefile rules
>for converting *.p files to corresponding *.py files, though.
>
>Note: I'm definitely not suggesting you _should_ use the C preprocessor
>for Python development.
>
Especially if you like to comment your python sources ;-)

Regards,
Bengt Richter




More information about the Python-list mailing list