Seeing Variables
[email protected] (Stefan Ram) 11 Jun 2025 10:30:42 GMT
| Newsgroups | comp.lang.python |
|---|---|
| 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)