0

我正在尝试使用 Zelle Graphics 编写一个简单的温度转换器 GUI,每次运行该模块时都会弹出一个窗口,显示一条错误消息

[Errno 13] Permission Denied

这是我的代码和我所拥有的。请帮忙。此外,当您运行代码时,我正在尝试获取可以单击某个区域(转换框)的代码,并且代码将继续运行。

# tempConverter-GUI
# Converts C to F using a simple GUI
# 2/17/16

from graphics import *

win = GraphWin("Temperature Converter", 300, 200)

c = Text(Point(100, 50), "Celsius Temperature: ")
c.draw(win)

cTemp = Entry(Point(200, 50), 5)
cTemp.setText("0.0")
cTemp.draw(win)

f = Text(Point(100, 150), "Fahrenheit Temperature: ")
f.draw(win)

convertedText = Text(Point(200, 150), "")
convertedText.draw(win)

box = Rectangle(Point(79, 69), Point(225, 123))
box.setWidth(10)
box.setFill("white")
box.draw(win)

button = Text(Point(150, 100), "CONVERT IT!")
button.draw(win)

location = win.getMouse()


fahrenheit = 9/5.0 * float(cTemp.getText()) + 32

convertedText.setText(fahrenheit)
button.setText("QUIT")
location = win.getMouse()

win.close()
4

0 回答 0