You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 variablesdefinit():
global__version____version__="0.1.0"
other.py:
importsettings# initialize variablessettings.init()
# Should print: The version is 0.1.0print"The version is: "+settings.__version__
The above is a simple example of how global variables can be sourced and consumed.
The text was updated successfully, but these errors were encountered:
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:
other.py:
The above is a simple example of how global variables can be sourced and consumed.
The text was updated successfully, but these errors were encountered: