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.
我正在尝试在 PyRun_InteractiveLoop 调用中设置本地/全局变量。无法弄清楚如何做到这一点,因为与 exec 对应物不同,循环不接受全局/本地参数。
我错过了什么?
如果您想要的是 exec 的 C API 版本,也许可以尝试一下PyRun_File?不确定您到底要完成什么。
PyRun_File