Skip to content

Instantly share code, notes, and snippets.

🎯
Focusing

João Faria j-faria

🎯
Focusing
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
adrn / cmd-line-function.py
Created Sep 24, 2013
Specify which function to run in a module from the command line
View cmd-line-function.py
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.