title: Execute python files through code
body: <p>I have a very simple, yet difficult question: I wasnt to execute a python script through python.</p>
  
  <p>The idea is really simple, I want to build a sort of like interlinked "scripts". It would work just like links in HTML, I have a game with different screens (such as main game, settings, etc), and when the user clicks on a "link" (E.g. Play Game), it would execute the maingame.py script in the main game subfolder.</p>
  
  <p>Now here comes the problem: I tried using <code>exec(open('somescript.py').read())</code> to open other scripts. However, the "python working folder" does not change (it doesn't change to the subfolder), and the imports in these scripts don't work because of this.</p>
  
  <p>Can anyone suggest an alternative?</p>