Hello all, I recently blogged about how listing all running processes is easy with IronPython [1].
This contrasts with the pywin32 solution we were using which is a 'touch' more obscure (!) and has recently started failing on one machine. However, I'm pretty certain that the pywin32 code we are listing is 'sub-optimal'. Can anyone suggest a better solution? (DISCLAIMER: I didn't write this, my colleagues 'borrowed' it from the intarwebz.) # check if AVG and Thunderbird are running import win32pdhutil for procName in ['avgwa.dat', 'avgw', 'thunderbird', "THUNDE~1"]: try: win32pdhutil.GetPerformanceAttributes('Process','ID Process', procName) except: pass if win32pdhutil.FindPerformanceAttributesByName(procName): print "Pylint error found: Please shut down %s" % procName win32pdhutil.ShowAllProcesses() sys.exit(1) All the best, Fuzzyman [1] http://www.voidspace.org.uk/python/weblog/arch_d7_2007_06_09.shtml#e739 from System.Diagnostics import Process procs = Process.GetProcesses() print "All running processes:" print '\n'.join(proc.ProcessName for proc in procs) _______________________________________________ Python-win32 mailing list Python-win32@python.org http://mail.python.org/mailman/listinfo/python-win32