title: How to properly close Python exe console program
body: <p>I'm trying to figure out how to do exit if the program is done with it's work. 
  What should I use? </p>
  
  <p>I've tried:</p>
  
  <pre><code>sys.exit()
  </code></pre>
  
  <p>and </p>
  
  <pre><code>os._exit(0)
  </code></pre>
  
  <p>But none of them worked in <code>exe</code> created by <code>Py2Exe</code>. It works when it is runned as a <code>py</code> script but if I create an <code>exe</code>, those <code>exit</code> commands do nothing.</p>