Pausing a process?
问题 Is there a way to pause a process (running from an executable) so that it stops the cpu load while it's paused, and waits till it's unpaused to go on with its work? Possibly in python, or in some way accessible by python. 回答1: By using psutil ( https://github.com/giampaolo/psutil ): >>> import psutil >>> somepid = 1023 >>> p = psutil.Process(somepid) >>> p.suspend() >>> p.resume() 回答2: you are thinking of SIGTSTP -- the same signal that happens when you push CTRL-Z . This suspends the process