I use Python 3.6.1 IDLE. I'd like to be able to run a sequence of scripts while maintaining the local environment (variables etc.) just as if I had entered all the commands line by line into the shell. However, whenever I execute a script the environment restarts and I lose all the variables from previous executions.
Is there anything I can do to prevent this restart? I don't want to have to type things line by line in the shell.
This question is similar to Run a module in IDLE (Python 3.4) without Restart but there's no convincing answer yet, maybe because the question is worded confusingly.
Edit: I'll give some background to make clearer why I want a second script to be run that shares state with the first one. I'm using Selenium Web Driver to forward emails from my University webmail account. If I log in too often, Outlook Web App realizes that something odd is going on and blocks access. So I want to do the log-in once with the first script and then be able to test different forwarding scripts on top of this first one. So what I can do, is run the first script and then type the second one into the shell one by one. But that's really annoying. It would be neat if I could just run a second script as if it was typed into the shell, i.e. without restart.