3

I'm making a nice little Python GUI frontend for ffmpeg on Windows (one that is specifically designed to convert videos to an iPhone-friendly format and automatically import it to iTunes and tag it), and I want it to work so that you can pause the process and resume it if you want.

Since I start ffmpeg as a separate process, the obvious solution would be for the program to suspend the process (which I know is possible in Windows, Process Explorer can do it), but I can't figure out how to do it. Does anyone have any idea how to do this in Python?

1 Answer 1

6

You can easily do this by using psutil ( https://github.com/giampaolo/psutil ):

import psutil pid = 1034 # replace this with the pid of your process p = psutil.Process(pid) p.suspend() 

...to resume it:

p.resume() 

Internally this is implemented in C by using SuspendThread() and ResumeThread() Windows system calls.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.