14 Topics

Member Avatar for
Member Avatar for fatalaccidents

Hello all, My question is hopefully particular enough to not relate to any of the other ones that I've read. I'm wanting to use subprocess and multiprocessing to spawn a bunch of jobs serially and return the return code to me. The problem is that I don't want to wait() …

Member Avatar for ~s.o.s~
0
4K
Member Avatar for krystosan

i am trying to recieve input from external text editor using python's `subprocess` but I am not sure why i am getting the error diff = subprocess.Popen('open(os.path.join(os.getcwd(), "foo.txt") "w")', stdout=subprocess.PIPE) pr = subprocess.Popen(sublime, stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True, stdin=diff.stdout) pr.wait() if pr.returncode == 0: msg = pr.stdout.read() print msg er = pr.stderr.read() …

Member Avatar for krystosan
0
374
Member Avatar for krystosan

Is there any way to start an application with python and count how much time does it take to completely load, any idea if I can do it with os.syste, or subprocess.Popen ?

Member Avatar for germ
0
272
Member Avatar for nagia.retsina

/home/nikos/public_html/cgi-bin/metrites.py in () 217 template = htmldata + counter 218 elif page.endswith('.py'): => 219 htmldata = subprocess.check_output( '/home/nikos/public_html/cgi-bin/' + page ) 220 template = htmldata.decode('utf-8').replace( 'Content-type: text/html; charset=utf-8', '' ) + counter 221 htmldata undefined, subprocess = <module 'subprocess' from '/opt/python3/lib/python3.3/subprocess.py'>, subprocess.check_output = <function check_output>, page = 'files.py' /opt/python3/lib/python3.3/subprocess.py in …

Member Avatar for nagia.retsina
0
355
Member Avatar for Meena Yegappan

Hi I am trying to run a python script which has this code snippet: process = subprocess.Popen('./start_ws.pl') process.wait() os.system('make') The perl script started changes environmental variables and enters into new subshell. After entering into new subshell, the commands below script os.system('make') goes unnoticed.They get executed only if i exit from …

Member Avatar for slate
0
490
Member Avatar for vegaseat

This small code example shows you how to approach the beginning concept of an very simple "IDE" for Python.

0
802
Member Avatar for oscargrower11

I'm trying to do something simple like get calc.exe to start minimized, but it's not happening. import subprocess import win32gui import win32con info = subprocess.STARTUPINFO() info.dwFlags |= subprocess.STARTF_USESHOWWINDOW info.wShowWindow = win32con.SW_SHOWMINIMIZED x = subprocess.Popen("calc.exe", startupinfo = info) It pops up the same as always, no matter what I provide for …

Member Avatar for TrustyTony
0
337
Member Avatar for oscargrower11

I've got an application that I call several times in a for loop using subprocess.call. Every time I call it, it starts minimized. I want it to be in a restored window. So what I've tried to do is get a handle on the window using win32gui.FindWindow. But in my …

0
108
Member Avatar for imixkumuku

I'm trying to open a tex file from within python, tell the tex editor to run (manually you would press ctrl + T) and finally close the program. So far I can only figure out how to open and close the program. this is what I have so far... os.spawnv(os.P_WAIT, …

Member Avatar for hughesadam_87
0
1K
Member Avatar for hencre

Hi Guys, I'm new to python - how to execute dos2unix from python - subprocess.popen with shell = False ? >>> cmd = subprocess.Popen(["dos2unix","./FEED1/bin/*"], stdout=subprocess.PIPE) dos2unix: converting file ./FEED1/bin/* to UNIX format ... >>> dos2unix: problems converting file ./FEED1/bin/* All help appreciated.

Member Avatar for hencre
0
1K
Member Avatar for _neo_

Hi. I want to run some shell commands on linux machine with python Popen, for ex. "ping". How I can terminate the process, if it isn't finished normally in a given time? I've tried write some code, can anybody improve it or give some better idea? Any suggestions appreciated. Thanx. …

Member Avatar for Gribouillis
0
1K
Member Avatar for theraven82

Hi, I have a for-loop, and in each iteration I have to open a dos-command. I use the subprocess module for this: [code=python] fid1=open("test.txt", 'w') p=subprocess.Popen(args, stdout=fid1, stderr=subprocess.STDOUT, shell=True) fid1.close() [/code] The output of the dos-command is written to the txt-file, but I still need to terminate the process p. …

0
105
Member Avatar for pietromarchy

Hi guys, I need your help. I am using python to synchronize several c programs. For one of these programs I need a dynamic interaction. I know there are several option: I am interested in the simplest one becouse I am noob. Python code and C code have to exange …

Member Avatar for pietromarchy
0
531
Member Avatar for Prahaai

Good day. I would need an advice about sys.stdout and sys.stderr. I use Python 2.6, on Windows XP SP3, but i think the question is the same for UNIX/ MAC computers. I tried all possible combinations before posting this message, so ANY advice would be great. I work with "subprocess" …

Member Avatar for Gribouillis
0
341

The End.