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
0 answers

Python 2.7.3: Loading animation (custom) while an os.system() command is running

Im making an easy package installer program in a CLI environment with python. and while the part where i execute os.system('dpkg -i ' + packageName + '--yes') i want to add like a loading thing like [####........] while the package installs
xR34P3Rx
  • 395
  • 9
  • 28
0
votes
1 answer

How to open a window from the command line within a Python script?

I am working on a python script to analyze astronomy images and I am trying to open a DS9 window within a python script (DS9 is a utility that allows images to be interactively viewed and analyzed). Usually I would open DS9 by going into the Linux…
sTr8_Struggin
  • 665
  • 2
  • 11
  • 27
0
votes
1 answer

File names have a `hidden' m character prepended

I have a simple python script which produces some data in a Neutron star mode. I use it to automate file names so I don't later forget the inputs. The script succesfully saves the file as some_parameters.txt but when I then list the files in…
Greg
  • 11,654
  • 3
  • 44
  • 50
0
votes
1 answer

Running a cmd command from a pyw file without a window popping out

so I am writing a python script that should run constantly in the background and once in a while pings a site to see if my router has failed. Anyway, since it's a python script, I am running it as a pyw file, but no matter what way I try calling…
GMan
  • 81
  • 7
0
votes
1 answer

Python starting application pauses while 1 loop

I have the following while loop in my Python script while 1: functionToGetXandY if x == z: os.system("google-chrome --start-maximized " + x) currentLink = latestLink if y == z: subprocess.call([vlc_path,…
dominic_89
  • 59
  • 1
  • 6
0
votes
2 answers

call linux command within python

Possible Duplicate: Equivalent of Backticks in Python I am looking for the best way to run a terminal command (ls -l) within Python. I have read about subprocess but I do not understand it fully, if someone could try and make me understand what…
bigl
  • 1,063
  • 3
  • 13
  • 23
0
votes
2 answers

Why is subprocess.call("""scp foo""") broken?

Success: >>> scp_cmd = r"sudo scp -i /home/backup/.ssh/id_rsa /opt/backups/*conf backup@a-hostname.local:/opt/backups/" >>> subprocess.call(scp_cmd, shell=True) 1eadmin1.conf 100% 83KB 83.5KB/s …
Mike Pennington
  • 41,899
  • 19
  • 136
  • 174
0
votes
1 answer

Python - How can I terminate a process after X seconds and continue the execution of python code?

Possible Duplicate: subprocess with timeout Best way to launch a process and block until it is finished I have a python code where I need to run a Linux command like "curl --user....". I need to run this command for 3600 seconds. After the 3600…
André
  • 24,706
  • 43
  • 121
  • 178
0
votes
3 answers

Python 2.6 - passing | char into os.system in for loop

I have a list of IP's that I want to run a whois (using the linux tool whois) against and only see the Country option. Here is my script: import os import time iplist = open('ips.txt').readlines() for i in iplist: time.sleep(2) …
D3l_Gato
  • 1,297
  • 2
  • 17
  • 25
0
votes
2 answers

Linux command from python won't finish

If I run adduser testuser from the terminal the command asks me some questions like for a password. But this code: import os a = os.system('useradd testuser') exist with error code 0 (no problem there). But it don't asks any question. Why is that?…
Niclas Nilsson
  • 5,691
  • 3
  • 30
  • 43
0
votes
1 answer

os.system commands

I am developing a program which needs to use os.system because of the old Python limitations. Currently I'm stuck in one small spot. os.system("C:\\FIOCheck\\xutil.exe -i get phy" +HBEA + ">C:\\FIOCheck\\HBEAResult.txt") This is the piece of code…
Matt
  • 11
  • 1
  • 1
  • 4
0
votes
0 answers

Preventing Blocking of os.system

I'm trying to run multiple Django development server using a python script, normally I run the server using a terminal command "python manage.py runserver PORTNumber". I want to be able to run multiple instances on different ports, but when trying…
askso
  • 85
  • 8
-1
votes
0 answers

Use python os.system call bash command, find %% has no effect

Use python os.system to call a bash command, I find that %% has no effect. This is my python code: outputpath = "./" command = "for dir in $(ls -d " + outputpath + '*/' + ");do echo ${dir%%/}/*.jpeg;done" print(command) os.system(command); The…
-1
votes
1 answer

Execute exe which needs input file in Python

Is there any way to run exe with inputs in Python? For example, there are two files, aaa.exe and bbb.dat. To run the analysis, I need to put those two files on DOS prompt like below. aaa.exe read the bbb.dat file. It there any command or workaround…
-1
votes
1 answer

How can I store a link in a variable and open it using os.system()

I want to make an app in Python to open links the user assigned to buttons. For that I have to assign links to variables and open them. I tried opening them with the webbrowser module, but they would open in Microsoft Edge and not in the default…
user19973965