RE: Open the command line within a script
- From: "Tim Golden" <tim.golden@xxxxxxxxxxxxxxxxxxxx>
- Date: Thu, 30 Jun 2005 15:26:51 +0100
[Ivan Shevanski]
| Hey this is probally a noob question but here goes. .. .How
| could I open the
| command line inside of a python script? Would I have to use COM?
(Assuming you're on Windows from your reference to COM).
Depending on exactly what you want to do with it, you could just do:
<code>
import os
shell = os.environ['COMSPEC']
os.system (shell)
# or
os.startfile (shell)
</code>
TJG
________________________________________________________________________
This e-mail has been scanned for all viruses by Star. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk
________________________________________________________________________
.
- Prev by Date: Open the command line within a script
- Next by Date: Re: Store multiple dictionaries in a file
- Previous by thread: Open the command line within a script
- Next by thread: python commmand line params from c++
- Index(es):
Relevant Pages
|