tags:

views:

29

answers:

1

I'm doing some AST modifications in Python. This may be done for optimization purpose or other.

Where is the right place to put it, so when you do something like:

pyhon myfile.py

or

python runserver.py myapp

the modifications took place for every .py executed file?

A: 

Put your modifications in a site.py or sitecustomize.py (Python < 2.6) file (in the lib/site-packages directory ; Python will try to import and run it @ interpreter startup).

ChristopheD
But how do I access to-be-executed python files from there?
Juanjo Conti