很抱歉这个长标题。
var1=5
print(var1)
from file1 import *
import file2
我怎样才能做到这一点?
答案 0 :(得分:0)
这样,也许:
[file1.py]:
var1=5
[file2.py]:
def foo(var1):
print(var1)
[file3.py]
import file1 as one
import file2 as two
two.foo(one.var1)