+ 2

how to solve this error?

File "C:\Users\Zhenis\AppData\Local\Programs\Python\Python37\lib\tkinter\__init__.py", line 1705, in __call__ return self.func(*args) File "C:/Users/Zhenis/Downloads/Robot_leg/robot_vZhenis_commentless_sebs_copy.py", line 337, in <lambda> b.append(Button(self.page[3], text="Niro IK", command=lambda: inverse_kin_leg(0))) File "C:/Users/Zhenis/Downloads/Robot_leg/robot_vZhenis_commentless_sebs_copy.py", line 303, in inverse_kin_leg p[j] = float(e[ikli*3+i].get() - 180) ##ikli is either 0 or 1 and i is either 0, 1 or 2, so ikli*3+i is either 0, 1, 2, 3, 4 or 5 TypeError: unsupported operand type(s) for -: 'str' and 'int'

20th Nov 2021, 4:16 PM
Zhenis Otarbay
Zhenis Otarbay - avatar
1 Réponse
+ 1
e[ikli*e+i].get() is a string 180 is an integer You cannot subtract an integer from a string
20th Nov 2021, 4:31 PM
Slick
Slick - avatar