Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handling global variables across source files #11

Open
AumitLeon opened this issue Aug 11, 2018 · 0 comments
Open

Handling global variables across source files #11

AumitLeon opened this issue Aug 11, 2018 · 0 comments
Labels
enhancement New feature or request

Comments

@AumitLeon
Copy link
Owner

Need a clean and concise way of handling global variables across our source files. Ideally, global variables will be declared and initialized within a single file (i.e a settings.py, or something similar). An example usage might look like the following:

settings.py:

# Initialize and store global variables

def init():
    global __version__
    __version__ = "0.1.0"

other.py:

import settings

# initialize variables
settings.init()

# Should print: The version is 0.1.0
print "The version is: " + settings.__version__

The above is a simple example of how global variables can be sourced and consumed.

@AumitLeon AumitLeon added the enhancement New feature or request label Aug 11, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant