On 11/22/2011 05:18 AM, David Lu wrote:
Hi, there.
I have two files:
a.py:
# -*- coding: utf-8 -*-
print('in a')
import b
print('var')
VAR = 1
def p():
print('{}, {}'.format(VAR, id(VAR)))
if __name__ == '__main__':
VAR = -1
p()
b.p() # Where does this VAR come from?
Hi, there.
I have two files:
a.py:
> # -*- coding: utf-8 -*-
> print('in a')
> import b
>
> print('var')
> VAR = 1
>
> def p():
> print('{}, {}'.format(VAR, id(VAR)))
>
> if __name__ == '__main__':
> VAR = -1
> p()
> b.p() # Where does this VAR come from?
>
b.py:
> # -*- coding