title: What is a safe and easy workflow for editing Python sources while they are being used?
body: <p>So I'm working on a Python 3 package and some functionalities are tested within scripts that can run for several hours/days on a remote machine.</p>
  
  <p>Before I started using multiprocessing (on Windows), there was no problem editing the source files, then starting the script and continue editing, because all the imports are resolved immediately and all the code remains in memory unchanged.</p>
  
  <p>With multiprocessing I'm getting syntax errors etc. when I'm in the middle of editing a file and the running script hits an import statement.</p>
  
  <p><strong>What is a safe way to edit my Python sources that doesn't interrupt my programming workflow too much?</strong></p>
  
  <p>I like the fact that I can try out ideas quickly and I don't want to add too many steps between making changes to the code and running it on the remote machine.</p>
  
  <p>My ideas:</p>
  
  <ul>
  <li><p>Use version control and work on a local copy on my local machine. <em>Problem here:</em> I have to do some of the debugging on the remote machine so I would have to push even minor changes while looking for small mistakes.</p></li>
  <li><p>Use version control and work on a copy on the remote machine. <em>Problem here:</em> If I understand this correctly, I would have to switch between a "debug" and "test" conda environment. Seems a bit tedious also.</p></li>
  <li><p>Find a solution to the multiprocessing issue .....</p></li>
  </ul>
  
  <p>I'm sure there is a way to do this right, can you help me out?</p>