Linked Questions

308 votes
10 answers
829k views

How do I execute a program from Python? os.system fails due to spaces in path [duplicate]

I have a Python script that needs to execute an external program, but for some reason fails. If I have the following script: import os; os.system("C:\\Temp\\a b c\\Notepad.exe"); raw_input(); Then ...
Lasse V. Karlsen's user avatar
337 votes
4 answers
536k views

Executing command line programs from within python [duplicate]

I'm building a web application that will is going to manipulate (pad, mix, merge etc) sound files and I've found that sox does exactly what I want. Sox is a linux command line program and I'm feeling ...
Mattias's user avatar
  • 5,189
15 votes
4 answers
55k views

Using python to run another program? [duplicate]

I have a program that I run from the command line that looks like this: $ program a.txt b.txt The program requires two text files as arguments. I am trying to write a Python 3.2 script to run the ...
drbunsen's user avatar
  • 10.5k
57 votes
2 answers
3k views

How to run another Python program without holding up original [duplicate]

What command in Python can be used to run another Python program? It should not wait for the child process to terminate. Instead, it should continue on. It also does not need to remember its child ...
Christopher King's user avatar
39 votes
1 answer
56k views

Run Rsync from Python [duplicate]

I need to run an rsync command from Python. Is this possible and if so, how do I do it? rsync -Ccavz --delete DJStatic username@website
Marcus's user avatar
  • 9,302
23 votes
4 answers
20k views

How to run commands on shell through python [duplicate]

Possible Duplicate: Calling an external command in Python I want to run commands in another directory using python. What are the various ways used for this and which is the most efficient one? ...
mrutyunjay's user avatar
  • 7,620
42 votes
1 answer
15k views

Execute terminal commands in python3 [duplicate]

I am on a Raspberry Pi, and I am using a program called fswebcam, which allows you to take pictures with a webcam. ~$ fswebcam image.jpg That command if entered in terminal takes a picture and saves ...
BrandonMayU's user avatar
13 votes
2 answers
7k views

Recommended way to run another program from within a Python script [duplicate]

Possible Duplicate: How to call external command in Python I'm writing a Python script on a windows machine. I need to launch another application "OtherApp.exe". What is the most suitable way to ...
G S's user avatar
  • 36.4k
10 votes
1 answer
6k views

Calling Inkscape in Python [duplicate]

Possible Duplicate: Calling an external command in Python I am trying to convert SVG files to PDFs in Python. I want to use Inkscape for this. How can I call Inkscape in Python ?
medusalith's user avatar
2 votes
1 answer
10k views

Python . Script to run exe file [duplicate]

I want to execute an exe file in script which requires command like this in commandline C:\pathtotool.exe -2 c:\data . how can i do this in python in windows. Os.system does not work
kalyani gandhi's user avatar
10 votes
2 answers
3k views

How to start a command line command from Python [duplicate]

I've got a series of commands I'm making from the command line where I call certain utilities. Specifically: root@beaglebone:~# canconfig can0 bitrate 50000 ctrlmode triple-sampling on loopback on ...
Chris's user avatar
  • 9,911
0 votes
2 answers
6k views

Running bash command in python [duplicate]

I'm trying to run a long bash command with several pipes inside. I did some research and found the use of os.chdir() to change to a working directory, and subprocess to execute bash commands. First I ...
Christina Do's user avatar
1 vote
2 answers
11k views

How to write a python script to open applications in linux mint [duplicate]

Hi I would like to write a python script so that if i run that script it should open couple of applications and run some commands in console.Can any one guide me through it. Like example scripts and ...
Sumanth Madishetty's user avatar
3 votes
2 answers
8k views

Capturing netcat shell command output in Python [duplicate]

I want execute netcat command from my python script, so I use the 'subprocess.Popen', but the problem is that the output of this command is directly printed in may shell console, i want o get him in a ...
user3383192's user avatar
12 votes
3 answers
623 views

Execute shell command and retrieve stdout in Python [duplicate]

In Perl, if I want to execute a shell command such as foo, I'll do this: #!/usr/bin/perl $stdout = `foo` In Python I found this very complex solution: #!/usr/bin/python import subprocess p = ...
nowox's user avatar
  • 28k

15 30 50 per page
1
2 3 4 5
35