【发布时间】:2021-04-24 08:15:45
【问题描述】:
我正在尝试将参数“a”从 file_a 传递给 file_b。那么如何在 file_b 中获取此变量
(page file_a.py)
class try():
def pass_this():
a = 7
(page file_b.py)
from file_a import try
如果有人可以解释我是否可以在不使用课程的情况下做到这一点(如果可能的话),它将帮助我
【问题讨论】:
-
Python 的基本组织是基于模块和包,而不是文件。
标签: python import python-class