hveagle 发表于 2024-2-5 16:18:42

求助【代号:66CDQZZ908520240205】

本帖最后由 hveagle 于 2024-2-5 16:22 编辑

1






























你以为我在吹水吗?
# 求助66CDQZZ908520240205报错
Traceback (most recent call last):
File "/Users/zhangxiang/Documents/六六湖秘密探险2.x(最新).py", line 75, in <module>
    button_a_window = Canvas.create_window(w, 330, 10, window=Button)
File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/tkinter/__init__.py", line 2885, in create_window
    return self._create('window', args, kw)
File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/tkinter/__init__.py", line 2847, in _create
    return self.tk.getint(self.tk.call(
_tkinter.TclError: bad window path name "4568773312Button"
# 求助66CDQZZ908520240205代码
button_a = Button(w, text='家', command=callback)
button_a_window = Canvas.create_window(w, 330, 10, window=Button)
button_b = Button(w, text='鱼C公园', command=callback)
button_a_window = Canvas.create_window(w, 330, 20, window=Button)
button_c = Button(w, text='食物超市1~6', command=callback)
button_a_window = Canvas.create_window(w, 330, 30, window=Button)
button_d = Button(w, text='武器超市1~6', command=callback)
button_a_window = Canvas.create_window(w, 330, 40, window=Button)
button_e = Button(w, text='LV1打工仔公司', command=callback)
button_a_window = Canvas.create_window(w, 330, 50, window=Button)

FishC 发表于 2024-2-5 16:18:55

抱歉,您的问题看起来并没有完整描述。请告诉我您遇到的具体编程问题,我将尽力帮助您解决。记得提供更多的细节和相关的代码,这样我才能更好地理解您的问题并给出准确的回答哦!

以上回复来自 FishC AI 小助理,如未能正确解答您的问题,请继续追问。

liuhongrun2022 发表于 2024-2-5 16:20:18

放代码

liuhongrun2022 发表于 2024-2-5 19:13:09

放完整代码

学习编程中的Ben 发表于 2024-2-5 19:13:52

# 求助66CDQZZ908520240205代码
button_a = Button(w, text='家', command=callback)
button_a_window = Canvas.create_window(w, 330, 10, window=button_a)
button_b = Button(w, text='鱼C公园', command=callback)
button_a_window = Canvas.create_window(w, 330, 20, window=button_b)
button_c = Button(w, text='食物超市1~6', command=callback)
button_a_window = Canvas.create_window(w, 330, 30, window=button_c)
button_d = Button(w, text='武器超市1~6', command=callback)
button_a_window = Canvas.create_window(w, 330, 40, window=button_d)
button_e = Button(w, text='LV1打工仔公司', command=callback)
button_a_window = Canvas.create_window(w, 330, 50, window=button_e)

......肯定是写你添加的按钮啊.试试看,对不对
页: [1]
查看完整版本: 求助【代号:66CDQZZ908520240205】