Im trying to declare some global variables in some functions and importing the file with those functions into another. However, I am finding that running the function in the
Globals in Python are only global to their module. There are no names that you can modify that are global to the entire process.
You can accomplish what you want with this:
globals.py:
value = 0
def default():
global value
value = 1
main.py:
import globals
def main():
globals.default()
print globals.value
if __name__ == "__main__":
main()
I have no idea whether a global like this is the best way to solve your problem, though.