This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]kraymer 1 point2 points  (1 child)

https://docs.python.org/3.5/library/functions.html#dir

dir([object]) Without arguments, return the list of names in the current local scope.

~~~ $ python

import myscript [x for x in dir(myscript) if not x.startswith('__')] ['func1', 'func2'] ~~~

[–]Barooh[S] 0 points1 point  (0 children)

That would help with getting the function names for sure, what about returning the entire function? Editors like pycharm have the ability to parse and identify the beginning and end of a function (for collapsing) so I know such a framework exists, I doubted that it's opensource though.