Noobie python shell question

Dave Angel davea at ieee.org
Mon Nov 30 05:08:19 CET 2009


tuxsun wrote:
> I've been working in the shell on and off all day, and need to see if
> a function I defined earlier is defined in the current shell I'm
> working in.
>
> Is there a shell command to get of list of functions I've defined?
>
> TIA!
>
> P.S. If it makes a difference, I'm using the shell from within IDLE,
> but once in a while I will use the python shell in a Bash console.
>
>
>   
dir() is the answer to the question you ask.  It'll display the entire 
global context.  But usually there's a better way.  If you think you 
previously defined a function
     def myfunc()
         ....

just enter myfunc at the prompt (without parentheses).  It should tell 
you it's a function, or undefined.


DaveA



More information about the Python-list mailing list