在TKINTER里的after循环函数中运行两个函数对外部变量累加赋值,为什么不成功?
import tkinter as tk
aa = 10
bb = [100]
def cat():
global aa
aa += 5
def dog():
bb[0] += 5
def game_loop():
cat()
dog()
base.after(FPS, game_loop)
print(aa)
print(bb)
FPS = 400
base = tk.Tk()
base.after(FPS, game_loop)
base.mainloop()
你知道打印出来的aa和bb是多少吗?原地不动
很不理解,求开悟