title: Rerun an "imported" external python file in a program?
body: <p>I'm trying to make a "head" python program capable of running my other programs, which can return to the head program. I am using import to load these files.</p>
  
  <p>In Head:</p>
  
  <pre><code>print("Running Tail...")
  import Tail
  </code></pre>
  
  <p>This successfully runs Tail.py, which in it has</p>
  
  <pre><code>print("This is the program.")
  print("Heading back to Head...")
  import Head
  </code></pre>
  
  <p>This successfully returns to Head.py. However, when Head.py tries to run Tail.py again, it fails to run Tail again. Perhaps is there a way to "unimport" an imported module for this purpose? Many thanks!</p>
  
  <p>EDIT: I understand that it would be best to use a function, however, this was a simplification, and eventually, I want to have complicated programs for heads and tails, to the point where heads will involve other programs, and tail programs can run at a larger scale, using defines and such themselves. I want "Head" to work like a game launcher from a library.</p>