Accesseing Variables from script A in script B

Hello everyone,

first off, im completely new to Blender and Python, trying to fumble my way through bit by bit.

Now i’ve come to a point, where i nee someone to point me in the right direction.

What I’m trying to do is have a on screen text, that displays the position of an animated object in realtime.
For my object im using the following script:

from bge import logic
cont = logic.getCurrentController()
sphere = cont.owner
spherepos = “%(name)s” % dict(name=sphere.position)
print (spherepos)

(the print command is just do check in the console, if my variable spherepos contains any plausible data and so far it works)

for my on screen text i use this code:

from bge import logic
from sphere import spherepos
cont = logic.getCurrentController()
pos = cont.owner
pos.text = “%(name)s” % dict(name = spherepos)

for some reason though, my on screen text just staticly shows one set of coordinates, which i dont recognize from anywhere…

I’d greatly appreciate any help.