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

Eric_Dexter at msn.com Eric_Dexter at msn.com
Sun Aug 13 18:12:44 EDT 2006


Caleb Hattingh wrote:
> 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

import cabel and reload(cabel) seem to work fine.  I am not sure why I
am having trouble with os.system .  Tells me it isn't a command.
thanks for the help, I will look into os.popen to see what it does.
would there be ay




More information about the Python-list mailing list