所以我有两个不同的文件,类似于这样:
file1.py
from file2 import * foo = "bar" test = SomeClass()
file2.py
class SomeClass : def __init__ (self): global foo print foo
然而,我似乎无法让file2识别file1中的变量,即使它已经被导入到file1中。如果有办法实现这一点的话,那将非常有帮助。
用户名或邮箱地址
密码