os.system always opens new window on Windows XP/2000

John ohgoddearlord at yahoo.com
Tue Jan 6 19:45:59 CET 2004


Can anyone tell me how to run a bunch of commands in the same command
line window?  When I do this:

system("command1")
system("command2")
...

it opens a new window for every system call.  The alternative I can
think of is to write out the command to a batch file and run that, but
I'm wondering if there is a better way to do it.

Partly it is annoying to have 20 cmd windows flash on the screen, but
also I don't think it works if I do something like this:

system("set envvar=hi")

since I think the envvar does not persist once the command window is
closed.

thanks!



More information about the Python-list mailing list