I've a python script that has to launch a shell command for every file in a dir:
import os
files = os.listdir(".")
for f in files:
os.execlp("myscript", "myscript", f)
This works fine for the first file, but after the "myscript" command has ended, the execution stops and does not come back to the python script.
How can I do? Do ...
I've got a c++ application with certain items in a queue, those items then are going to be processed by a python script. I want it so that at maximum 10 instances of the python script are running. I plan on using execl() to launch the python process, Is there a way to tell that the process has quit without having to pass a message back t...
I have a problem with a little C script which should run as a server and launch a popup for every message arriving.
The execl syntax is correct because if I try a little script with
main() { execl(...); }
it works.
When I put it in a while(1) loop it doesn't work. Everything else is working, like printf or string operation, but not ...
Hello,
I have a file a.txt with lines of commands I want to run, say:
echo 1
echo 2
echo 3
If I was on csh (unix), I would have done source a.txt and it would run.
From python I want to run os.execl with it, however I get:
>>> os.execl("source", "a.txt")
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File...
I'm running into some trouble with deploying Django on the passenger_wsgi module with virtualenv. The Python code in the passenger_wsgi.py file, which should fix my problem is:
import os, sys
INTERP = '/home/login/.virtualenvs/env_name/bin/python'
if sys.executable != INTERP:
os.execl(INTERP, INTERP, *sys.argv)
The first three lin...