Thread Python qui ne rend pas la main
Bonjour, je souhaite faire un Thread Python pour lancer un programme en arrière plan et avoir tout de suite après la main.
Je fais donc:
Code:
1 2 3 4 5 6
| import threading
import os
commande = "C:\Programmes\Python25\python.exe D:\test.py 2008 03 01 00 00 01 2008 03 02 23 59 59"
a = threading.Thread(None, os.popen, None, (commande,), {})
a.start()
print "Test" |
Dans lequel test.py est un programme qui marche très bien et qui est très long à s'executer.
Mais quand jexuste ce code, Python ne me rend pas la main (sablier sous Python Win, bloqué en ligne de commande, bloqué en Apache/Mod_Python).
(Mon but final est en fait de pouvoir lancer des programmes python depuis un site Intranet, sans avoir à attendre leur fin d'execution).
Quelqu'un a une idée de pourquoi Python ne me rend pas la main (le thread ne marche pas)?
Merci!
Daz