Using switches with exec?

Francis Avila francisgavila at yahoo.com
Mon Jan 12 15:09:10 EST 2004


Premshree Pillai wrote in message ...
>Hmm...maybe I should have been clearer.
>What I need to do is run an external Python code from
>within another program, and while doing so I need to
>pas a switch (yes, like a command-line switch) to this
>code; i.e., I need to open an external Py program from
>within another Py program...

Use os.system or os.popen, not exec. It doesn't matter at all that the
program you're executing happens to be a Python program.

But if it's already written, and you can modify it, you might as well
package it up nicely to use as a module.  Then you won't be bothering with
switches at all, and you won't have to rely on os services.
--
Francis Avila




More information about the Python-list mailing list