473,320 Members | 1,926 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Windows commands in Python

2
Hello all,

I am a fairly new user of python and was given an assignment to try and execute windows commands in python. I've done a fair amount of searching on the internet and haven't come up with anything. I was just wondering if there was some kind of python method that did this?

Thanks for any help,
Brent
Mar 9 '07 #1
4 3375
ghostdog74
511 Expert 256MB
Hello all,

I am a fairly new user of python and was given an assignment to try and execute windows commands in python. I've done a fair amount of searching on the internet and haven't come up with anything. I was just wondering if there was some kind of python method that did this?

Thanks for any help,
Brent
what do you actually want to achieve? for example, do you want to move files , copy files? edit some files? or do you just purely wanted to call actual native windows commands like dir, mv,copy, etc from Python?
Mar 9 '07 #2
BSman
2
I want to perform the latter...be able to call native windows commands from python.
Mar 9 '07 #3
ghostdog74
511 Expert 256MB
I want to perform the latter...be able to call native windows commands from python.
check out the os process management here . also, there's a newer module called subprocess
Mar 9 '07 #4
dshimer
136 Expert 100+
There was also a thread called "Opening an exe" that gave some examples, though the goal was slightly different. For simple stuff I usually use the popen() methods that are found in the docs pointed out by ghostdog74.
Mar 9 '07 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: Christian Long | last post by:
Hi I'm trying to pipe data into a python program on Windows 2000, on the command line. Like this: dir | myProgram.py Here's what I tried:
5
by: Isaac Raway | last post by:
Hello. I'm writing a Python program that connects to servers through telnetlib to execute a few commands. I've discovered that some of the servers that I have to connect to with this program run...
12
by: Moosebumps | last post by:
So, after reading some messages about os.system, and looking at the popen stuff and trying it a bit, I still have not found a way to keep a command window open for several commands (on Windows...
0
by: Leo | last post by:
Does someone know if there is a setting in the python Unix world to make the command history behave as it does in the Windows intepreter? Specifically, I like the fact that the command history...
2
by: timdoyle05 | last post by:
Hi, I have a question relating to how Unix commands can be issued from Python programs. Im am currently writing a large test script in python and I need this script to call three other separate...
3
by: diffuser78 | last post by:
I am a newbie in Python and want your help in writing python script. I have to remotely shut the windows px from linux box. I run OpenSSH on windows PC. I remotely connect it from Linux box using...
14
by: miago | last post by:
Searching this forum I found an example of running Unix commands from Python;I wonder if there is a way to get the output of windows commands on a string using Python.Thanks in advance; Miago.
1
by: yadin | last post by:
hi! i need to know how i can run ussal commands that i ussally type at the windows command prompt from a python file. that is for example from the windows command prompt i ussually type "cd...
4
by: fang | last post by:
Dear all: The mouse cannot be responded in the windows of python(command line) and cut and paste cannot be done. ctrl c and ctrl v do not work. But they do work in IDLE. please teach me about...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....

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.