Apr-24-2017, 11:33 AM
# This is File A from fileb import bvar bvar = 10Think of what you do here,you just overwrite the import
bvar
So the import has no meaning here.
Eg:
# fileb.py bvar = 10
# filea.py from fileb import bvar avar = 99 print('var for filea {}\nvar from fileb {}'.format(avar, bvar))
Output:var for filea 99
var from fileb 10
So here i don't overwrite the import and can use value from fileb in filea.