为了账号安全,请及时绑定邮箱和手机立即绑定

Python 3.6 tkinter 表示未定义 GROOVE

Python 3.6 tkinter 表示未定义 GROOVE

BIG阳 2022-01-05 20:32:48
几分钟前,下面的程序运行良好。我进行了更改,运行了代码,犯了一个小错误,Spyder 崩溃了,现在它要么找不到 Frame 或 Groove 或其他东西。目前它说没有定义GROOVE。尝试用小写字母和引号来写。当我使用引号时,它说: TclError:浮雕“凹槽”:必须是平的、凹槽的、凸起的、脊的、实心的或凹陷的。当我做没有引号的小写或大写时,表示没有定义凹槽。from RiskFactorConversion import *from tkinter import ttk, StringVar, Frame, Label, Tk, Entrymainwindow = Tk()mainwindow.title("Risk Factor Conversion")datatype = StringVar()dataconvention = StringVar()mdlname = StringVar()instancevalue = StringVar()axisvalue = StringVar()def g():    datatype = e1.get()    dataconvention = e2.get()    mdlname = e3.get()    instancevalue = e4.get()    r1 = rates.srtqualifier(mdlname,datatype,dataconvention,instancevalue)    l5["text"] =r1.makequalifier()def f():    datatype = e5.get()    dataconvention = e6.get()    axisvalue = e8.get()    fx1 = fx.felixfxvol(datatype,dataconvention,axisvalue)    l11["text"] =fx1.fxvol()def h():    datatype = en1.get()    dataconvention = en2.get()    fx2 = fx.murexfx(datatype,dataconvention)    la4["text"] =fx2.makequalifier()#########Felix Frame####################################frame1 = Frame(bg="white", colormap="new", padx = 10, relief=GROOVE, borderwidth=2)frame1.grid(row = 0, column = 0)l0 = Label(frame1, text= "FELIX Rates", pady =5, font = ('Georgia',14,'bold'), bg="white")l0.grid(row = 0, column = 0,sticky= W )l1 = Label(frame1, text= "Please provide Data Type:",bg="white", justify = "right",pady =5 )l1.grid(row = 1, column = 0, sticky= E )e1 = Entry(frame1,bd = 2, width =50, textvariable = datatype )e1.grid(row = 1, column = 1)e1.focus_set()l2 = Label(frame1,bg="white", text= "Please provide Data Convention:",justify = "right", pady = 5)l2.grid(row = 2, column = 0,sticky= E)e2 = Entry(frame1,bd = 2, width =50, textvariable = dataconvention )e2.grid(row = 2, column = 1)l3 = Label(frame1,bg="white", text= "Please provide Model Type:", justify = "right",pady = 5)l3.grid(row = 3, column = 0,sticky= E)################################################################
查看完整描述

1 回答

?
白猪掌柜的

TA贡献1893条经验 获得超10个赞

Groove 是在 Tkinter 中定义的常量,由于您只从 Tkinter 导入不包含 Groove 的特定函数,因此您需要向其中添加 GROOVE 或添加

import tkinter as tk

然后设置救济= tk.GROOVE


查看完整回答
反对 回复 2022-01-05
  • 1 回答
  • 0 关注
  • 195 浏览
慕课专栏
更多

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信