Morgen zusammen,
ich suche schon die ganze Zeit nach einer möglichkeit zu überprüfen, ob ein Programm gestartet ist.
Ich will mir mein eigenes Backup-Script schreiben, was auch die Kontakte Bookmarks aus Mozilla und Thunderbird kopiert, nur kann man diese nicht kopieren, wenn diese Programm gestartet ist. Ich habe schon die ganze Zeit gesucht, aber nichts gefunden, gibt es unter Windows eine Möglichkeit herausufinden, ob z.B. Firefox gestartet ist? Der Prozess heisst ja dann firefox.exe.
MFG Bambie
Windows, Programm gestartet
Vielleicht hilft dir das: http://www.python-forum.de/post-91085.html#91085
Naja, das Problem ist ja, dass Firefox schon gestartet ist, ich bin jetzt zumindest weiter und habe folgendes gefunden:
Getting the process list: PdhEnumObjectItems
The python call is similar though simpler. For example, you do not need to bother with the list length -- it takes care of that for you. Both the python and C++ examples are taken from their COM components shown later.To call make with python would look like the following
Aber wofür stehen die Parameter und was muss ich für self übergeben?
Getting the process list: PdhEnumObjectItems
The python call is similar though simpler. For example, you do not need to bother with the list length -- it takes care of that for you. Both the python and C++ examples are taken from their COM components shown later.To call make with python would look like the following
Code: Alles auswählen
def proclist(self):
try:
junk, instances = win32pdh.EnumObjectItems(None,None,self.object, win32pdh.PERF_DETAIL_WIZARD)
return instances
except:
raise COMException("Problem getting process list")
Dafür gibt es im Cheeseshop auch schon fertiges Ei:
http://pypi.python.org/pypi/enumprocess/
http://pypi.python.org/pypi/enumprocess/