C'est peut être une question bête mais, j'arrive pas à trouver la commande en python qui pourrait me permettre de lancer un programme bash (avec arguments si possible).
Ca donnerait:
executer("./machin -arg1")
Merci d'avance :-)
a=os.fork() if a==0: # Processus enfant si j'ai bien compris launch_dwl() else: #Ce que je voudrait executer en même temps, mais dans le processus parent
b=os.fork()
if b==0:
launch_dwl()
c=os.getpid()
else:
a=open("./les_pids","w")
d=os.getpid()
a.write(c+"\n"+d)
a.close()
#!/usr/bin/python
import threading,time,os
def launch_main():
os.system("./main")
def launch_dwl():
os.system("./dwl_raw")
b=threading.Thread(target=launch_dwl)
b.start
a=threading.Thread(target=launch_main)
a.start
time.sleep(20)
print a
print b
Combien cela coûte-t-il au total ? Quelles aides apportent l'état et les acteurs du marché pour alléger cette charge non choisie ? Tous les détails sur Commentçamarche.net.
Toute la doc (en anglais) : http://docs.python.org/library/subprocess.html