My Code:
def A():
a = \'A\'
print a
return
def B():
print a + \' in B\'
return
When B() is entered into the interpeter
check out my answer from this SO question. Basically:
Create a new module containing only global data (in your case let's say myGlobals.py
):
# create an instance of some data you want to share across modules
a=0
and then each file you want to have access to this data can do so in this fashion:
import myGlobals
myGlobals.a = 'something'
so in your case:
import myGlobals
def A():
myGlobals.a = 'A'
print myGlobals.a
def B():
print myGlobals.a + ' in B'