Skip to content

Instantly share code, notes, and snippets.

@tag1216
Created September 23, 2016 01:20
Show Gist options
  • Save tag1216/3dc09f82c2add8a1132c13e69037bf6e to your computer and use it in GitHub Desktop.
Save tag1216/3dc09f82c2add8a1132c13e69037bf6e to your computer and use it in GitHub Desktop.
Pythonで動的にモジュールメンバーを追加
for member in dir(module):
if re.match(r"^[A-Z][A-Z_]+$", member):
sys.modules[__name__].__dict__[member] = module.__dict__[member]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment