Is it possible to pass a Text widget to another file? I have a main.py
file and a second file named fuction.py
. Can I do the following?
in the main.py
:
myText = Text(miFrame,width = 117, height = 18).place(x=20, y = 171)
function.some_function(myText)
And in the function.py
:
def some_function(myText):
myText.insert(END, "bla bla bla")
When I try to execute the above code I receive the following message:
AttributeError: 'NoneType' object has no attribute 'insert'