Skip to content

Instantly share code, notes, and snippets.

@pydevops
Last active January 24, 2019 22:09
Show Gist options
  • Select an option

  • Save pydevops/a54c8b29fc95e3df6d99fc0a77a12f49 to your computer and use it in GitHub Desktop.

Select an option

Save pydevops/a54c8b29fc95e3df6d99fc0a77a12f49 to your computer and use it in GitHub Desktop.
python refer name defined in another module

main.py

import config
globals().update(config.constants())
print(PI)

config.py

def constants():
    c={'PI':'3.14'}
    return c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment