Я могу читать по одной строке за раз из поля ввода и отображать ее в новом окне, но мне нужно перейти к следующей строке кода.
Вот текстовые поля вGUI
self.sourcecode = Text(master, height=8, width=30)
self.sourcecode.grid(row=1, column=1, sticky=W)
self.nextline = Button(master, text="Next Line", fg="orange", command=lambda:[self.nextLine(self.intcount), self.lexicalResult()])
self.nextline.grid(row=12, column=1, sticky=E)
self.lexicalresult = Text(master, height=8, width=30)
self.lexicalresult.grid(row=1, column=3, sticky=W)
Это мои функции для копирования из одного ящика в другой (вывод insert()
в функцию lexicalResult()
)
def nextLine (self, intcount):
print("Reading from source")
self.linenumber.delete('1.0', END)
self.intcount = self.intcount + 1
self.linenumber.insert('0.0', self.intcount)
self.retrieve_input()
def retrieve_input(self):
lines = self.sourcecode.get('1.0', '2.0') #I need to take this and move to the next line but i am new to python and don't know what functions there are or their arguments
self.lexicalresult.insert('1.0', lines)
def lexicalResult (self):
print("Printing to result")