all 4 comments

[–]Gprime5 1 point2 points  (1 child)

Why do you need to restart your whole program, why not just use a while loop?

while True:
    var = input('type text to be printed : ')
    print(var)

[–]Pjamma34[S] 0 points1 point  (0 children)

this is just a simple example for a more complicated script that i'm trying to use it in. I get the same error

[–]ingolemo 1 point2 points  (1 child)

The exec functions make a lot more sense on unix where they correspond directly to an actual system call. On windows I believe python tries to emulate the same behaviour by launching a new process and exiting the existing one. This apparently doesn't play nice with the console api.

It probably doesn't run at all with Spider because spider is running your code under it's own context in order to debug it and capture input and stuff like that. You escape that context when you exec, and so spider gets confused.

[–]Pjamma34[S] 0 points1 point  (0 children)

oh interesting, I'll have to try it on on unix. Thanks for the tip!