Skip to content

Instantly share code, notes, and snippets.

@mhtocs
Created April 19, 2020 14:50
Show Gist options
  • Save mhtocs/03cd6be0cefd1e5db6c780364abba570 to your computer and use it in GitHub Desktop.
Save mhtocs/03cd6be0cefd1e5db6c780364abba570 to your computer and use it in GitHub Desktop.

Revisions

  1. mhtocs created this gist Apr 19, 2020.
    16 changes: 16 additions & 0 deletions list_callables_2.py
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,16 @@
    import math #import whatever


    def list_callables(module):
    all = []
    for k,v in module.__dict__.items():
    if callable(v):
    try:
    all.append(v.__name__)
    except:
    pass
    return all

    math_callables = list_callables(math) #fetch all function

    print(math_callables)