I am trying to read value of a variable from one file to another file, but I am not able to read only the value of variable. See sample script of two files. Most the forms gives information regarding access of variables in another file. When i implement those methods I am not getting as what i am expecting.
file name: t1.py
print 'Hello'
a=123
print 'welcome'
file name: t2.py
from t1 import a
print 'Python'
print a
When I run the above script output I am getting is
Python
Hello
Welcome
123
But I am expecting the output must be:
Python
123
Is there any way for getting only content of single variable in a big python script.