wir kann ich unter Win32 eine Datei "sauber" öffnen? Ich habs schon mit dem os-Modul versucht:
Code: Alles auswählen
import os
os.system("C:\\text.exe")
Gibts da keine bessere Möglichkeit? (Bei os.exec* wird Python ja beendet)
Code: Alles auswählen
import os
os.system("C:\\text.exe")
Code: Alles auswählen
import os
>>> os.spawnlp(os.P_NOWAIT, "C:\\test.exe")
Traceback (most recent call last):
File "<pyshell#2>", line 1, in ?
os.spawnlp(os.P_NOWAIT, "C:\\test.exe")
AttributeError: 'module' object has no attribute 'spawnlp'
Code: Alles auswählen
#! /usr/local/bin/python
import time,os,sys
def start():
x = os.getloadavg()
count = 1
for i in range(3):
if x[0] <= 0.7:
print "starting job ..."
op = 'python test.py ' + str(count)
#os.popen(op)
os.spawnv(os.P_NOWAIT, sys.path, op)
count += 1
while 1:
x = os.getloadavg()
if x[0] <= 0.5:
print x
print "starting job ..."
os.popen('python test.py ' + str(count))
count += 1
time.sleep(0.1)
if __name__=="__main__": start()
GrußAvailability: Unix, Windows. spawnlp(), spawnlpe(), spawnvp() and spawnvpe() are not available on Windows. New in version 1.6.