How would I globalize globalme1, 2 and 3 variables?
def example(globalme1, globalme2, globalme3=''):
print("")
I tried globalizing them before the function.
globalize: Make accessible to other functions
How would I globalize globalme1, 2 and 3 variables?
def example(globalme1, globalme2, globalme3=''):
print("")
I tried globalizing them before the function.
globalize: Make accessible to other functions
Don't, instead use return values:
def example(argument1, argument2, argument3 = ""):
print("")
# do some things with your inputs
return argument1, argument2, argument3
Then you can call the function like this to automatically unpack the function output:
value1 = "example"
value2 = 42
value3 = "yay, return values"
value1, value2, value3 = example(value1, value2, value3)
or like this to get a tuple:
values = example(value1, value2, value3)
see also Why are global variables evil?