title: After python program imported and run variables persist in IDLE but not at cmd (win) or terminal (osx)
body: <p>I have set up my programming environment on win pc and mac osx using notepad++ and text-wrangler respectively. On both computers I have set up a shortcut/alias to the python34->lib-> site-packages so I can quickly import my programs from the interpreter prompt. On the win pc I have included this line in the environment variables path: </p>
  
  <p>C:\Python34;C:\Python34\Scripts;C:\Python34\Lib\site-packages</p>
  
  <p>This allows me to access python 3.4 from cmd 
  On OSX terminal I simply launch the interpreter by typing python3</p>
  
  <p>All this works great to run small code examples that I am working through in text books but why is it that variables in the imported modules seem to be only temporary? While in IDLE if I open the same file and run the 
  variables are still recognized. </p>
  
  <p>example </p>
  
  <pre><code>test.py 
  
  word = 'pizza' 
  
  print(
  
  '''
  Slicing "Cheat Sheet"
  
  0    1    2    3   4    5
  
   +---+---+----+----+----+
   |  p  |  i  |  z |  z |  a |
   +---+---+----+---+-----+
  -5   -4   -3   -2   -1 
  
  ''' 
  )
  
  print ('Enter the beginning and ending index for your slice of "pizza".')
  print ('Press the enter key at the "Begin" to exit.')
  
  start = ''
  
  while start == '': 
      start = (input('\nStart: '))
  
  
      if start: 
          start = int(start)
  
          finish = int(input('Finish: '))
  
          print('word [', start, ':', finish, '] is', end=' ')
          print(word[start:finish])
  
  input ('\n\nPress the enter key to exit.') 
  </code></pre>
  
  <p>importing this at cmd or terminal runs the code. but after typing variable word at prompt gives </p>
  
  <p>nameerror name 'word'is not defined </p>
  
  <p>whereas in IDLE after the module has run typing in the variable word will give the assigned expression 'pizza'. Why is this?  </p>