top | item 41167378

Show HN: Python Code Resumption. A way to stop and resume a Python script

4 points| ag_rin | 1 year ago |github.com

Wanted to share this crazy little idea I had and implemented. Not sure if anyone has tried to do this in python before, but I wanted a way to interrupt a python script and then restart it from the interrupt point later.

Obviously the implementation is very POC and simple, but it works. Let me know your thoughts! What crazy python stuff have you done?

5 comments

order

jawerty|1 year ago

This looks like it's exactly what i need for a project im working on. Right now Im actually starting a thread and raising an exception to stop it and restart which is not very safe.

ag_rin|1 year ago

If its not a secret, do you mind sharing what the use case is? I'm curious because my thoughts originally were that this would be useful when running something that takes more than the trivial few minutes to finish.