I\'m trying to get this script to write information into a basic text file. I\'m still learning python.
The problem lies here:
file_text = \"\"\"%s SHOOT
The variables only exist in the scope you declare them
def fun():
x = 5
return x
>>> x
Traceback (most recent call last):
File "", line 1, in
x
NameError: name 'x' is not defined
If you want to use the return
value from a function, then call the function and assign it to such a variable
>>> x = fun()
>>> x
5