擅长:python、mysql、java
<p><strong>更新答案:</strong></p>
<p><strong>试试这个:</strong></p>
<p><strong>球蛋白.py:</strong></p>
<pre><code>global x
x = 10
</code></pre>
<p><strong>fun1.py:</strong></p>
^{pr2}$
<p><strong>主.py:</strong></p>
<pre><code>from fun1 import *
from GlobalVar import *
print("X before fun1=", GlobalVar.x)
func1()
print("X after fun1=", GlobalVar.x)
</code></pre>
<p>勾选这个,这将根据你的问题给你想要的输出。在</p>
<p>希望这对你有帮助!谢谢你!:)</p>
<p><strong>注意:</strong>全局表字典是当前模块的字典(在函数内部,这是定义它的模块,而不是调用它的模块)</p>