Quantcast
Viewing all articles
Browse latest Browse all 4897

Python • Re: How do I fix this Python code?

No, the point is when you stop the code it stops the recording. Is there a command or something like sys.exit() I accomplish this?
There's atexit. You might want to try putting something like this near the top of your code, but after where you define send_command():

Code:

import atexitdef stop_recording():    send_command("Stop")    atexit.register(stop_recording)# ... the rest of your code follows

Statistics: Posted by scruss — Thu Feb 29, 2024 4:53 pm



Viewing all articles
Browse latest Browse all 4897

Trending Articles