Python Forum

Full Version: how to bind entry to a function in another file
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
so i have an entry box when i enter something into it and press enter it will print the value. when the function which i am binding into is in same python file then it is working but how i can bind entry_box to function in another file . i tried it but it doesn't seem to work. here is my code
from tkinter import *
import two

root = Tk()
entry_var = StringVar()
entry_box = Entry(root)
entry_box.bind("<Return>",lambda entry_var:two.function)
entry_box.pack()
root.mainloop()
what does the module two contain?