Created
September 23, 2016 01:20
-
-
Save tag1216/3dc09f82c2add8a1132c13e69037bf6e to your computer and use it in GitHub Desktop.
Pythonで動的にモジュールメンバーを追加
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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