Python turtle屏幕均匀调整大小

2024-05-23 17:40:52 发布

您现在位置:Python中文网/ 问答频道 /正文

我正在为海龟创建一个屏幕,如下所示:

import turtle

playground = turtle.Screen() 

playground.setup(width=500, height=500, startx=None, starty=None)

一切都很好。但是,如果用户调整python窗口的大小,我该如何反应和调整“游乐场”的大小呢?是否有任何回调方法,或者如何找出python窗口的当前大小?你知道吗


Tags: 方法用户importnone屏幕setupwidthscreen