Seeing Variables

[email protected] (Stefan Ram)
Newsgroups gmane.comp.python.general
Organization Stefan Ram
Message-ID <[email protected]>
  Did you know that after your program has terminated in IDLE,
  you still can see the variables in the shell?

  For example:

  IDLE editor

a = 1   (user input)

  [F5] - run   (user input)

  IDLE shell

a   (user input)
1   (system output)

  But how to achieve the same for local variables? E.g.,

  IDLE editor

def f():      (user input)
    a = 1     (user input)

  IDLE shell

a   (user input)
NameError: name 'a' is not defined   (system output)
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.