python 獲得當前進程的信息(cpu 內存佔用等)

能夠用這個函數:python   import commands, os, re def process_info(): pid = os.getpid() res = commands.getstatusoutput('ps aux|grep '+str(pid))[1].split('\n')[0] p = re.compile(r'\s+') l = p.
相關文章
相關標籤/搜索