Possible Duplicate:
Global Variable from a different file Python
is that possible to set variable in different file ?
So I have two different files somewhat like this..
tes1.py
import test2
st = 'a'
def main():
mis = input('puts: ')
print tes2.set(mis)
main()
tes2.py
def set(object):
pics = ['''
%s
1st
'''%st,
'''
%s
2nd
''']
return pics[object]
and i execute tes1.py and issued an error:
NameError: global name 'st' is not defined
thanks for the respond