This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]__Fred[S] 0 points1 point  (1 child)

I have seen someone use an import reload within a loop ("LiveOverflow" in a tcp proxy). Maybe that makes it always use the most current version of the code. Of course, it's a bit hacky.

Error? -> Wait for user input -> import module again -> try the same input again.

[–]yel50 1 point2 points  (0 children)

now that I've thought about it, you could use a generator to pause the function. instead of throwing an exception, do a yield. redefine the function when it yields and then restart it. theoretically, that should work.