I have looked up a couple of solutions to this problem, but none of them seem to work. Lets just say I have a file named "Var", where I simply put:
myvar = 25
print("myvar is equivalent to 25.")
And then I have another file called "Run", where I put:
from Var import myvar
print(myvar)
From the "Run" file, the only thing I want to access from that file is the variable, but when I actually run the code, it runs the entire file, so the output is:
myvar is equivalent to 25.
25
All I want to do is access the variable but for some reason it is running the entire file! How do I get it so that it only gets the variable and doesn't run the entire file?