RE: Open the command line within a script



[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
________________________________________________________________________
.



Relevant Pages

  • Open the command line within a script
    ... Hey this is probally a noob question but here goes. ... .How could I open the command line inside of a python script? ... Check out the new MSN Search! ...
    (comp.lang.python)
  • RE: sftp-server on solaris8
    ... command was failing to execute the command "ksh -c ... It seems to me that SSH and SFTP are having trouble talking remotely... ... anti-virus service working around the clock, around the globe, visit: ...
    (SSH)
  • Make error: DBD-Oracle-1.14 , DBI-1.39, Oracle rdbms 9.2.0.0.0 , solaris 9
    ... The Makefile made my message too big to include however if anyone wants it I ... produces those flags from my command line I get Don't know how to make ... anti-virus service working around the clock, around the globe, visit: ...
    (perl.dbi.users)
  • RE: Using MSMQ on Windows (and Navision)
    ... | a Python script. ... snip ...] ... No help here, I'm afraid. ... anti-virus service working around the clock, around the globe, visit: ...
    (comp.lang.python)
  • RE: best way of testing a program exists before using it?
    ... |> I am writing a wrapper to a binary command to run it and then do ... portability you certainly won't). ... for ext in exts: ... anti-virus service working around the clock, around the globe, visit: ...
    (comp.lang.python)