Activating Batch Files from Python

Ben C spamspam at spam.eggs
Wed Apr 19 17:33:31 EDT 2006


On 2006-04-19, Jeff Groves <mikelemmer6 at yahoo.com> wrote:
>>How about sourcing it from a shell, then using that same shell instance
>>to run the programs?
>
> How would I do that? As I've said, I haven't found a Python command
> that lets you send multiple commands to the same shell yet. If I could,
> my problem would be solved.

If I understood correctly I think the idea is to run vars.bat first,
then run the Python program in _that_ shell (so it inherits the
environment) and then launch the other programs from the Python program.

i.e.

C:\> vars.bat
C:\> python launcher.py

You could put those commands in a batch file. So the outermost thing you
run is a batch file, which starts Python, which starts the other
programs.

Seems quite a neat solution.



More information about the Python-list mailing list