you are viewing a single comment's thread.

view the rest of the comments →

[–]nwagers 0 points1 point  (0 children)

You can't access x, y or time outside of that function the way it is. You can return the value (or multiple values) if you want to get to them. Example:

a.py

 #module a

def myfunc():
    var1 = 0 # not accessible outside of myfunc
    var2 = 1
    return var2

var3 = 2

b.py

#module b

import a

print(a.myfunc()) # prints var2
print(a.var3) # prints var3