So, I'm confused. I have a module containing some function that I use in another module. Imported like so:
from <module> import *
Inside my module, there exist functions whose purpose is to set global variables in the main program.
Some of the global variables need to be assigned to the output of another function in that same module.
Example:
def fubar(var):
var *= 2
return var
def foo(var1, var2):
global bar
bar = fubar(var1)
But I encounter this error:
Traceback (most recent call last):
File "blah", line 92, in setup_configs
bar = fubar(var1)
NameError: global name 'fubar' is not defined
And I'm wondering, do I have to set the function I am referring to as global for this to work? It seems kinda... funny.