Is there any way of using Python to open a command prompt?
Command Prompt
Collapse
This topic is closed.
X
X
-
EASTags: None -
Lee Harr
Re: Command Prompt
On 2004-05-21, EAS <eriksp@attbi.n ospam.com> wrote:[color=blue]
> Is there any way of using Python to open a command prompt?
>
>[/color]
Almost certainly going to depend on your system.
I would use ...
import os
os.system('xter m &')
-
EAS
Re: Command Prompt
Depend on the operating system or the computer? The two OS I use are Windows
XP Pro and
Windows NT 2000 Pro.
Comment
-
Terry Reedy
Re: Command Prompt
"EAS" <eriksp@attbi.n ospam.com> wrote in message
news:Cnurc.5$hi 6.3519@attbi_s5 3...[color=blue]
> Is there any way of using Python to open a command prompt?[/color]
You may need to be more specific. On various versions of Windows, in batch
or interactive mode, os.system('comm and.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).
Terry J. Reedy
Comment
-
Peter Hansen
Re: Command Prompt
Terry Reedy wrote:
[color=blue]
> "EAS" <eriksp@attbi.n ospam.com> wrote in message
> news:Cnurc.5$hi 6.3519@attbi_s5 3...
>[color=green]
>>Is there any way of using Python to open a command prompt?[/color]
>
>
> You may need to be more specific. On various versions of Windows, in batch
> or interactive mode, os.system('comm and.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).[/color]
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.
-Peter
Comment
-
EAS -
Michael Geary
Re: Command Prompt
Peter Hansen wrote:[color=blue]
> 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.[/color]
There's a huge difference between the two. cmd.exe is a 32-bit console
application, and command.com is a 16-bit DOS application. You definitely
want cmd.exe on the NT versions of Windows (NT, 2000, XP).
-Mike
Comment
Comment