Python – Using a binder key to move the entry cursor in tinter

So I asked a question earlier in which @TigerhawkT3 assisted me, however now that I am implementing what what suggested over a program involving 2 classes I am running into an error. The code I am working with is as follows:

from tkinter import *

class Calc:
    def __init__(self,parent):
        self.displayentry = StringVar()
        self.display=Entry(parent, textvariable=self.displayentry)
        parent.bind('<Return>', CalculatorLogic.equal_input)

class CalculatorLogic:
    def equal_input(self, event):

root = Tk()

The error I am having with the above code tells me, “TypeError: equal_input() takes exactly 2 arguments (1 given)” when I press the enter key.

Thank you so much for your time and assistance.

Source: python

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.