title: Close Python script, then immediately relaunch
body: <p>I'm using Python (Vizard) to launch a virtual reality environment on a laptop remotely. I need to do this remotely, because the laptop is closed and being worn in a backpack by the user who is also wearing a head mounted display. I am able to open a network connection and send commands which cause a virtual reality environment to load on the laptop, but I'm not able to close the environment without closing Vizard completely.</p>
  
  <p>In order to launch, I add a network, like this:</p>
  
  <p><code>myNetwork = viz.addNetwork('computer_name')</code></p>
  
  <p>I then wait for a network message using a network event callback:</p>
  
  <pre><code>def onNetwork(e):
      loadWorld(e.preferences)
  
  viz.callback(viz.NETWORK_EVENT, onNetwork)
  
  def loadWorld(preferences):
      &lt;&lt;...&gt;&gt;
  </code></pre>
  
  <p>So, this works nicely, and boots the player into the virtual reality environment with the preferences specified in <code>preferences</code>. But if I send another message over the network, the new world is superposed on top of the old world, and there doesn't seem to be a useful method for closing the virtual reality environment in a tidy manner.</p>
  
  <p>Since I can't deconstruct the virtual reality environment in a decent way, it seems better to reboot the whole program from the beginning. There is a command in Vizard, <code>viz.quit()</code>, but if I insert this before the <code>loadWorld</code> function call, the program stops running completely and never reaches <code>loadWorld</code>. So, I wonder if there's another way I could do this: have the program close, but have the whole script running in a loop so that when the program closes, it immediately relaunches again.</p>
  
  <p>The question: how do I tell a Python script to close and deallocate all resources, but then to immediately relaunch itself afterwards?</p>