如:在a.py文件有一个变量a = bool(),b.py去运行a.py,然后我希望能获取a.py运行后a的值,该如何去获取?
PHP中文网2017-04-18 09:27:12
Oops, the file name and variable name are duplicated.
In b.py, import a
to get the global variables in the a.py file
ringa_lee2017-04-18 09:27:12
a.py
a = 1
b = "2"
def f():
return "function"
b.py
import a
a = a.a
from a import b,f
print(b)
f()