Running a file, with a relative filename

Phil Hunt philh at vision25.demon.co.uk
Mon May 10 17:24:28 EDT 1999


I want to run a python program, where one module causes another Python
module to execute, where the pathname of the second module is known 
relative to the first module.

i.e. I have:

   ~/project/dev/xxx/prog1.py
   ~/project/dev/xxx/prog2.py

And:

   ~/project/live/yyy/prog1.py
   ~/project/live/yyy/prog2.py
   

(The reason for this is that I have separate development and live 
versions of the project, and the development version of prog1 wants
to run the development version of prog2, and the live version of
prog1 wants to run the live version of prog2).

prog2.py typically contains constants for the progject, e.g:

   nntpServer = "news.demon.co.uk"

etc. The constants will typically be different on the live and
development versions.

-- 
Phil Hunt....philh at vision25.demon.co.uk





More information about the Python-list mailing list