looking for a simple way to load a program from another python program..

Caleb Hattingh caleb.hattingh at gmail.com
Sun Aug 13 16:48:05 EDT 2006


Hi Eric

Check that ".py" and ".pyw" are in your PATHEXT environment variable
(are you using Windows?).   Then, if the folder that cabel is in is in
your PATH environment variable, and the correct association for .py
files is set up (i.e. they get run by python.exe),

either
os.system('cabel')
or
os.system('cabel.py')

should work.

Alternatively, you could not do any of those things, and run

os.system('python cabel.py')

with 'cabel.py' in the same folder as the parent script, and that
should work too, assuming that the path to your python executable is on
the PATH environment variable.

If you run other commands from python quite frequently, it is probably
a good idea to look into the "os.popen" set of commands, for more
flexibilty.

Caleb




More information about the Python-list mailing list