Questions tagged [os.system]

os.system is a python standard library function. It executes the given string argument as a command in a subshell.

638 questions
0
votes
2 answers

Error with os.system in python script

I am creating a python script that will convert files using ffmpeg and unoconv. However when I run the program, rather than getting a converted file the program simply displays the text: sh: 1: unoconv -f: not found Here is the script for my…
0
votes
1 answer

Python: os.system() redirecting stdout to file in home directory fails

I used the following command : os.system('scanimage > ~/test.pnm') but I can't find the image. Any suggestions?
0
votes
0 answers

Can't find the scanned image

I used os.system to call the scanimage command, it works fine but I can't find the scanned image ! any help? thanks in advance os.system ('scanimage > ~/test.pnm')
0
votes
1 answer

issues with os.system() not generating output

When I run the program I get everything up to q outputted as it should be, but the .mafft that should be created by q is coming back empty. Edit: I forgot to ask the actual question. What am I doing wrong here? Is it some syntax I am unaware…
slick1092
  • 17
  • 6
0
votes
1 answer

Python executing commands in the command prompt (taskkill)

I'm trying to use os.system to use the taskkill command in command prompt. ill gut out the only part im having trouble with: os.system('taskkill /s %s /u CORP\Administrator /p CLARiiON! /pid AxAuto.exe'%(connection[i])) The variable connection[i]…
bladexeon
  • 696
  • 3
  • 10
  • 31
0
votes
1 answer

Start local PHP script w/ local Python script

The Python program I'm writing needs to start a local PHP script outside of Python's process. The program also needs to pass params to the PHP script. So far this seems to start the script: os.system( path_to_script_here param param ) However, I'm…
JeremyFromEarth
  • 14,344
  • 4
  • 33
  • 47
0
votes
1 answer

os.system to subprocess.Popen or subprocess.call

I have a function as below which is working fine when I execute my python code in CMD (SIMT is an executable). However, when I built my executable with py2exe, a shell window quickly appear and disappear. So I searched and found out that I can use…
Hamid K
  • 983
  • 1
  • 18
  • 40
0
votes
3 answers

Running a script from within a Python script

I am attempting to run a python script located in a folder on my server from another python script. The location of the script I am attempting to run is not in the same location as the existing script. The script I am trying to execute is not a…
risail
  • 509
  • 5
  • 14
  • 37
0
votes
1 answer

Avconv command to combine image and audio file (to create a video)

Trying to perform a simple task: combine an image file with an audio file to create a video. I've already found a few examples using ffmpeg, but I'm using a cloud-based PythonAnywhere and they only use avconv. Code would look something like…
0
votes
0 answers

Countdown in python

def blue(): global blue_old global blue_new while blue_old > blue_new: blue_old = blue_old - 0.01 print blue_old os.system("echo 21=" + str(blue_old) + " > /dev/pi-blaster") time.sleep(0.01) …
user3570799
  • 81
  • 1
  • 4
0
votes
1 answer

command wrapped in os.system is ignored

(on os x 10.10.1)I am trying to use a paired-end merger (Casper) within a python script. i'm using os.system (don't want to use subprocess or pexpect modules). In my script here is the line that doesn't work: os.system("casper %s %s -o…
0
votes
1 answer

Cannot Play After Rename File - TypeError: cannot concatenate 'str' and 'NoneType' objects

I have an error when after rename files and want to access it using the module os.system. namely the script os.system('mpg321' + ren). I've done os.chdir on the path. but still it is still not working. Here I use the power mpg321 for player. and…
agaust
  • 97
  • 3
  • 19
0
votes
1 answer

How to telnet and collect logs, Whenever the IP is alive/active?

PING: import os ip=1.1.1.1 o=os.system("ping "+ip) time.sleep(10) print(o) if res == 0: print(ip,"is active") Telnet: tn = telnetlib.Telnet(IP) tn.write(command+"\r\n") f=open(filename,w) while True: response = tn.read_until("\n") …
Jackie James
  • 785
  • 8
  • 15
  • 28
0
votes
1 answer

wrap python os.system method

I have the following perl module for wrapping CORE::system in perl scripts: package system_wrapper; sub check_system { my ($cmd) = @_; my $err = CORE::system($cmd); if ($err != 0) { print "Error occured when executing: $cmd.…
ldgorman
  • 1,553
  • 1
  • 14
  • 39
0
votes
2 answers

os.system python function in a while loop

I am trying to make a simple python script to automatically click in ubuntu 14.04. here is my code #!/usr/bin/python import os clickCounter = 0 while clickCounter == 0: timeNow = os.system('date +\"%s\"') if timeNow > 10: …