Is it possible to display a list of all user functions in the IDLE session?
I can see them popping up in the autocomplete, so maybe there is other way to just display on
If I understand the question... try dir()
import my_module
dir(my_module)
just edit what lunixbochs wrote
def fun(): pass
print([f.__name__ for f in globals().values() if type(f) == type(fun)])
This should work:
print([f for f in dir() if f[0] is not '_'])
Tested on version 3.5.2
.
dir()
will essentially give you a list of callable objects within the current scope.
You can list all user-defined functions without any imports by
print([f.__name__ for f in globals().values() if type(f) == type(lambda *args: None)])
Note that
lambda *args: None
stands for function that does nothing and can be replaced by any arbitrary function.
This should give you a list of all functions in the global scope:
import types
print([f for f in globals().values() if type(f) == types.FunctionType])