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
1 answer

How to close program in python opened by os.system()?

In python 3.4 , I was trying to open a "wav" file using vlc in Linux. Here is my code: import os,time os.system("cvlc audio/some.wav") time.sleep(3) #audio was one and half sec a = 3+3 print (a) It plays the audio but then doesn’t do the rest.…
nazmus saif
  • 167
  • 1
  • 2
  • 12
0
votes
3 answers

wget not working in python

I am using the os module to issue a wget request through python. It looks something like this: os.system("wget 'http://superawesomeurl.com'") If I issue the wget request straight from terminal, it works, but I have two problems: When I build this…
Elyza Agosta
  • 581
  • 2
  • 5
  • 8
0
votes
1 answer

Using os.system() in python to execute linux command

I use script in python to fetching mails from Postfix server. This script fetches mails, removes headers and leaves only body of email. Then it uses this body to execute linux command by os.system(). For example I'm sending email with mkdir folder…
mac
  • 23
  • 8
0
votes
1 answer

calling several matlab commands from python using os.system

I just want to call two matlab commands from Python: the fist command just adds the folder and subfolders fo the desired path ( addpath(genpath('c:/file1/file2')) ), while the second command calls the function I want to use ( myfunction.m …
anna
  • 43
  • 1
  • 1
  • 5
0
votes
1 answer

run command in interactive opend bash with python

I use this script to run interactive VLC bash: import os import sys if len(sys.argv) > 1: tmp = os.popen('vlc -I rc --novideo --noaudio --rc-fake-tty -q udp://@1.2.3.4:1234').read() else : print "Error: no input" now in this bash…
user3726821
  • 123
  • 1
  • 12
0
votes
2 answers

Issue in python when using the shutdown function

I will provide a video to show you as well what is going on, here is the link to the video displaying this strange issue: https://www.youtube.com/watch?v=o9RUR7t18NA&list=UU0OG8tltECja7Sgxa9A5Drg The source code is uploaded to pastebin which you can…
XallZall
  • 281
  • 1
  • 3
  • 5
0
votes
1 answer

Python application, py2exe, Inno Setup, os.system() start function does not work

I have made some application with PyQt4, which contains os.system() start function in it as a button, which basically opens a csv file. import sqlite3 import sys import os ....... class Ui_MainWindow(object): def setupUi(self, MainWindow): …
0
votes
1 answer

os.startfile() using RDC

I have a cherrypy server running on my windows box. It handles requests for opening files in their default editors. (requests just contain filepath) When two users are logged in to same Windows server (using RDC), for an open file request issued by…
Vink
  • 1,019
  • 2
  • 9
  • 18
0
votes
1 answer

OS command doesn't work in eclipse

I've got this weird problem: I added the path of libsvm's .exe files to my PATH. When I type svm-train (a libsvm command) into my cmd - it recognizes the command, and works as expected. When I use python's IDLE GUI, and…
Cheshie
  • 2,777
  • 6
  • 32
  • 51
0
votes
2 answers

passing variable defined as files to os.system()

I am trying to write a short program that would pass variables for a os.system(). Where the variables are defined as following: code = 'code.py' input_file = 'input.xxxx' output_file = 'output.xxxx' import os os.system("python code input_file…
0
votes
2 answers

change directory in os.system

How should I use os.system to run script for several directories. I tried this: listofdirnumbers = [1, 2, 3, 4, 5] for i in range(len(listofdirnumbers)): os.system("script.py 'arg1 "mydir_%d"%i arg2 '") But it gave me the error of invalid…
user3041107
  • 123
  • 2
  • 13
0
votes
2 answers

getting label's date using python and p4v

I'm trying to get a label's date. The cmd command that I know is: p4 labels -e the_label_name The indeed gives me the following: Label the_label_name 2014/06/05 00:05:13 'Created by mebel. ' To use python, I wrote: os.system("sc labels -t -e…
NimrodB
  • 153
  • 3
  • 13
0
votes
0 answers

os.system in a loop

For each item in a list, I am modifying a file and then I want to run the python script, "ncall.py", which imports the modified file called, "new_basketparams.txt". I also want to make sure ncall.py completes its process before recalling it, but…
teachamantofish
  • 75
  • 1
  • 1
  • 7
0
votes
2 answers

Python: os.system(ping) argument not working?

I am trying to make a def statement that uses os.system(ping) with a variable, and it does not want to take the variable: import os def myping(myip): print(myip) ip1 = os.system("ping -c 1 myip") print(ip1) myping("127.0.0.1") This…
spideyclick
  • 162
  • 1
  • 1
  • 12
0
votes
1 answer

Simple But Repeating Issue with Formatting/FileLocationErrors

These are the 3 scripts I'm working on which are to be used in other various scripts, the 4th one is an example piece: 1 import os data_dir = os.path.expandvars (r"C:\Users\%USERNAME%\AppData\Roaming\Microsoft\Windows\Start…
Rejnaps
  • 113
  • 2
  • 12