More specifically, I have a file
file file1.py:
if __name__ == '__main__':
a = 1
and from file file2.py, I want to do something like
import file1
print file1.a
without modifying file1.py
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…