Display a list of user defined functions in the Python IDLE session

前端 未结 4 1295
野性不改
野性不改 2021-02-09 11:02

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

4条回答
  •  不思量自难忘°
    2021-02-09 11:37

    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])
    

提交回复
热议问题