Path: csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail From: ram@zedat.fu-berlin.de (Stefan Ram) Newsgroups: comp.lang.python Subject: Seeing Variables Date: 11 Jun 2025 10:30:42 GMT Organization: Stefan Ram Lines: 29 Expires: 1 Jun 2026 11:59:58 GMT Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Trace: news.uni-berlin.de U6TmzxPqYjvhDA18U29VWwjUs/qEV4hepwSIwlk3WabEk4 Cancel-Lock: sha1:vi8YrMZoeo5wlGqs50Sr2V/QJFk= sha256:JAShIEne+OfxI4HzEE+whXKYad9gT9gP9mnt7TrAUyY= X-Copyright: (C) Copyright 2025 Stefan Ram. All rights reserved. Distribution through any means other than regular usenet channels is forbidden. It is forbidden to publish this article in the Web, to change URIs of this article into links, and to transfer the body without this notice, but quotations of parts in other Usenet posts are allowed. X-No-Archive: Yes Archive: no X-No-Archive-Readme: "X-No-Archive" is set, because this prevents some services to mirror the article in the web. But the article may be kept on a Usenet archive server with only NNTP access. X-No-Html: yes Content-Language: en-US Xref: csiph.com comp.lang.python:197506 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)