Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个要调试的文件 light.py。在 python 控制台中,我输入“import light”并运行程序。但我想通过输入变量来检查一些变量的内容。我怎么做?
test您的文件中有一个名为的变量light.py
test
light.py
import light print light.test
如果要在程序运行期间进行测试,则需要使用pdb来调试执行