title: In IPython console (Spyder), can I access a variable from main() after running my program?
body: <p>I am running my code using an IPython Console. I have a <code>main()</code> function that is executed as follows:</p>
  
  <pre><code>if __name__ == "__main__":  
      main()
  </code></pre>
  
  <p>Then <code>main()</code> calls a bunch of other functions and I don't use any classes.
  My question is, can I print or manipulate my variables interactively in the console after running my program?</p>
  
  <p>Like if I don't have <code>main()</code> or any other functions, for example I can declare in my code: </p>
  
  <pre><code>a=1
  </code></pre>
  
  <p>And then it is easy to access from the console:</p>
  
  <pre><code>In [20]: a
  
  Out[20]: 1
  </code></pre>
  
  <p>Thank you in advance if you can help with this noob question. </p>