【发布时间】:2021-04-25 11:49:09
【问题描述】:
我想用 Python Turtle 制作这个简单的游戏,但是,在使窗口保持相同大小且无法调整大小方面遇到了很多麻烦。我已经确定检查了谷歌的第二页,是的。
import turtle
class Window:
def __init__(self, dim):
self.win = turtle.Screen()
assert type(dim) == type((1, 2))
self.win.setup(width=dim[0], height=dim[1])
self.win.setworldcoordinates(0, 0, dim[0], dim[1])
def init(self):
self.win.mainloop()
a = Window((100, 100))
a.init()
这是我的代码,希望你有愉快的一天!
【问题讨论】:
-
我的意思是我还在问一个问题
标签: python-3.x turtle-graphics python-turtle