python tcl,Python tcl没有正确安装

在尝试运行使用`graphics.py`的Python代码时,遇到TclError,提示找不到可用的init.tcl文件且存在版本冲突。问题可能是由于Tcl未正确安装或者版本不匹配。解决方案包括编辑init.tcl文件调整Tcl版本要求,或者下载并安装最新版Tcl。
摘要由CSDN通过智能技术生成

I just installed graphics.py for python. Then, when I tried to run the following code:

from graphics import *

def main():

win = GraphWin("My Circle", 100, 100)

c = Circle(Point(50,50), 10)

c.draw(win)

win.getMouse() # Pause to view result

win.close() # Close window when done

main()

My interpreter gave me this strange information:

Traceback (most recent call last):

File "F:\CS 101\Python\projects\packer.py", line 8, in

from graphics import *

File "F:\CS 101\Python\lib\site-packages\graphics.py", line 168, in

_root = tk.Tk()

File "F:\CS 101\Python\lib\tkinter\__init__.py", line 1674, in __init__

self.tk = _tkinter.create(screenName, baseName, className, interactive, wantobjects, useTk, sync, use)

_tkinter.Tcl

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值