From Python to Shell

Fredrik Lundh fredrik at pythonware.com
Thu Jun 8 10:28:49 EDT 2006


NightHawk wrote:

> Im not a total noob but i don't know the command and the module to go
> from python to the default shell.

I'm not sure what you mean by "go to", but if you want to start an 
interactive OS shell from inside Python, you can do:

	>>> import os
	>>> os.system(os.environ["SHELL"])

on Unix, and

	>>> import os
	>>> os.system(os.environ["comspec"])

on Windows.

</F>




More information about the Python-list mailing list