Skip to content

Instantly share code, notes, and snippets.


João Faria j-faria

Block or report user

Report or block j-faria

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
adrn /
Created Sep 24, 2013
Specify which function to run in a module from the command line
import sys
def some_name():
print("function 1")
def some_other_name():
print("function 2")
if __name__ == "__main__":
func = getattr(sys.modules[__name__], sys.argv[1])
You can’t perform that action at this time.