title: how to stop a python script before it goes to end
body: <p>In the main script, I want to stop it under some condition. I tried <code>return</code> but it is wrong since it is outside the function. I tried <code>exit</code>, but it does not stop. See the following: </p>
  
  <pre><code>print 'step 1'
  exit
  print 'step 2'
  </code></pre>
  
  <p>what should I do ? 
  the version I used is IDLE 2.7.5+</p>