473,473 Members | 1,857 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Command Prompt

EAS
Is there any way of using Python to open a command prompt?
Jul 18 '05 #1
6 2604
On 2004-05-21, EAS <er****@attbi.nospam.com> wrote:
Is there any way of using Python to open a command prompt?


Almost certainly going to depend on your system.
I would use ...
import os
os.system('xterm &')

Jul 18 '05 #2
EAS
Depend on the operating system or the computer? The two OS I use are Windows
XP Pro and
Windows NT 2000 Pro.
Jul 18 '05 #3

"EAS" <er****@attbi.nospam.com> wrote in message
news:Cnurc.5$hi6.3519@attbi_s53...
Is there any way of using Python to open a command prompt?


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).

Terry J. Reedy


Jul 18 '05 #4
Terry Reedy wrote:
"EAS" <er****@attbi.nospam.com> wrote in message
news:Cnurc.5$hi6.3519@attbi_s53...
Is there any way of using Python to open a command prompt?

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).


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
Jul 18 '05 #5
EAS
It works! Thanks.
Jul 18 '05 #6
Peter Hansen wrote:
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.


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
Jul 18 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: msuk | last post by:
All, I am trying to use Regasm from the command prompt and have to keep putting the full file path of where my assembley is located. Does anyone know how to set it up so wherever I run the...
3
by: Rog | last post by:
Yes, I am guessing that typing cmd in the run windows will bring up the command prompt, but not the vs.net command prompt. Is there a switch(s) for accessing the vs.net command prompt? Or...
4
by: glenn | last post by:
I keep reading all sorts of books on VS that keep telling me to click on Tools/Visual Studio Command prompt to run this program or that program. However, I do not have such a menu choice. Where is...
4
by: Thomas Johnson | last post by:
I am trying to find out how to access the VS 2003 .Net command prompt. I am trying to execute the 'csc' command against a module but have no idea where to find the command prompt. Here's a stupid...
6
by: Jwolf | last post by:
I have .net 2002 edu version and when it installed there was a shortcut to the .net command prompt. My CLR disk is scratched so I can't reinstall and so I just downloaded express. I dont know...
6
by: Shooter4Life8 | last post by:
Hi, I am having trouble figureing out the best way to open a command prompt then write lines to it in VB.NET. Currently I have this code, but it execute's too fast I think because Dim psi As...
9
by: Endless Story | last post by:
My last version of Python was 2.4, running smoothly on XP with path c: \Python24 - no need even to include this path in PATH; everything worked as it's supposed to at the command line. Just...
4
by: Peter Nimmo | last post by:
Hi, I am writting a windows application that I want to be able to act as if it where a Console application in certain circumstances, such as error logging. Whilst I have nearly got it, it...
3
by: kimiraikkonen | last post by:
Hi experts, I just want to ask a simple procedure of my simple form. My form has a input textbox and a button. I want this if you can help me: Application user types a command prompt command...
7
by: Jwe | last post by:
Hi, I've written a program which has both a command line interface and Windows form interface, however it isn't quite working correctly. When run from command line with no arguments it should...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.