E
EAS
Is there any way of using Python to open a command prompt?
Is there any way of using Python to open a command prompt?
EAS said:Is there any way of using Python to open a command prompt?
Terry said:You may need to be more specific. On various versions of Windows, in batch
or interactive mode, os.system('command.com') might or might not do what
you want. On Win XP, interactive mode, one is already in a command window
and the above gives a command prompt 'C:/Python...' in the same window,
where one can do dir, cd, type, etc, and finally exit to return to Python
and its prompt (again in the same window).
Peter said:Minor issue: on Win XP, there is a "command" and a "cmd".
Here's the visible difference between the two:
c:\>cmd
Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.
c:\>command
Microsoft(R) Windows DOS
(C)Copyright Microsoft Corp 1990-2001.
Presumably there are other, more significant differences
as well.
Probably advisable to use "cmd" under WinXP, but that's
just a hunch.
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.