Forums

Method insert() for python tkinter function

Good afternoon,

I'm using Tkinter for developing a tool and in this function I need to set the value of 3 Entry of a different class (Toplevel1) but it seems that every time that i use set() or insert() methods the previous Entry widgets are cleared. You know how to fix this problem?

ps follows the code. pps sorry for my very poor english.

import main

def function(self):

global _top1, _top2, var1, var2, selection

selection = self.TCombobox1.get()

main.Toplevel1(_top1).TCombobox1.set(selection)
main.Toplevel1(_top1).Entry1.insert(0,var1)
main.Toplevel1(_top1).Entry2.insert(0,var2)

_top2.withdraw()

Hi there -- these are the forums for PythonAnywhere, an online development environment, so we can't really give help with code that you are running on your own machine. Perhaps Stack Overflow would be a good place to post your question?

Yeah for sure, sorry i'm a very newcomer of programming forums, by the way thank you very much for the feedback.