无法将sequence乘以'str'类型的nonit

2024-04-25 21:52:53 发布

您现在位置:Python中文网/ 问答频道 /正文

import time
import sys
import Tkinter
from Tkinter import *

aa = Tk()
aa.title("SPUR GEAR CALCULATIONS")
aa.geometry("600x500+100+100")
aa.grid()

z = Label (aa, text=("WELCOME TO THE SOFTWARE SOLUTION OF MECHANICAL PROJECTS"),font=3)
z.place(x=30,y=5)

x = Label (aa, text="BY    AATHIF  AHMED  O   F ",font=1)
x.place(x=180,y=30)

c = Label (aa, text="------------------------------------------------------------------        ------------------------------------------------------------------------------------------ ",)
c.place(x=0,y=50)

v = Label (aa, text="GIVEN DATA:")
v.place(x=0,y=65)

b = Label (aa, text="Module, m = ")
b.place(x=0,y=80)

n = Label (aa, text="No. of teeth, Z = ")
n.place(x=0,y=100)

L1 = Variable
L1 = Entry (aa,width=10)
L1.place(x=70,y=80)

L2 = Variable
L2= Entry (aa, width=7)
L2.place(x=90,y=100)

我想错误就在这里

^{pr2}$

我认为错误在这里有些地方也有

int=(Z)
int=(m)

PD = (Z*m)
AD = (m)
DD = (1.25*m)
WD = (2*m)
TD = (2.25*m)
OD = ((Z+2)*m)
TT = (1.5708*m)
CC = (0.25*m)
CP = (3.1428*m)
RF = (0.4*m)

PD=str(PD)
AD=str(AD)
DD=str(DD)
WD=str(WD)
TD=str(TD)
OD=str(OD)
TT=str(TT)
CC=str(CC)
CP=str(CP)
RF=str(RF)

s = Label (aa, text="SOLUTION : ")
s.place(x=0,y=125)

pd = Label (aa, text="Pitch Diameter, d ="+PD)
pd.place(x=0,y=140)

ad = Label (aa, text="Addendum,      ha = "+AD)
ad.place(x=0,y=160)

dd = Label (aa, text="Dedendum,      hd = "+DD)
dd.place(x=0,y=180)

wd = Label (aa, text="Working Depth,    = "+WD)
wd.place(x=0,y=200)

td = Label (aa, text="Tooth Depth,    h = "+TD)
td.place(x=0,y=220)

od = Label (aa, text="Outside Diameter OR Blank Diameter, D = "+OD)
od.place(x=0,y=240)

tt = Label (aa, text="Tooth Thickness, S = "+TT)
tt.place(x=0,y=260)

cc = Label (aa, text="Clearance,       C = "+CC)
cc.place(x=0,y=280)

cp = Label (aa, text="Circular Pitch,  p = "+CP)
cp.place(x=0,y=300)

rf = Label (aa, text="Radius of Fillet   = "+RF)
rf.place(x=0,y=320)

sc = Label (aa, text="SELECTION OF CUTTER: ")
sc.place(x=0,y=350)

cs = Label (aa, text="selected cutter is:  ")
cs.place(x=0,y=370)

aa.mainloop()

请解决这个错误,我知道我犯了一个愚蠢的错误,但我想知道它是什么。。。。这只是机械中的一个简单问题。工程师。在


Tags: textimport错误placelabeladddtd
1条回答
网友
1楼 · 发布于 2024-04-25 21:52:53

要将输入转换为int(),请使用int()作为函数。它返回转换后的值:

Z=int(Z)
m=int(m)

相反,您的代码首先将Z,然后将m分配给一个本地名称int,屏蔽了内置的。在

下一个问题是你没有给用户任何机会在你的程序中输入文本。我建议您多读一些tkintergui教程;直到您启动主循环,您的最终用户才能与您的UI交互并输入文本。在

相关问题 更多 >