test_num = 0; # 首先声明一个全局变量 def test_fun() : global test_num; # 使用全局变量的时候要先 声明我使用的是全局变量 test_num++; test_fun();