Python Forum
how to bind entry to a function in another file
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
how to bind entry to a function in another file
#1
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()
Reply
#2
what does the module two contain?
Recommended Tutorials:
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  [Tkinter] bind menator01 1 1,249 Apr-15-2022, 08:47 PM
Last Post: menator01
  [Tkinter] compare entry with value inside file rwahdan 1 2,073 Jun-19-2021, 08:01 AM
Last Post: Yoriz
  [Tkinter] bind lambda keypress counter knoxvilles_joker 15 7,763 Apr-19-2021, 01:56 AM
Last Post: knoxvilles_joker
  [Tkinter] Mouse click without use bind ATARI_LIVE 8 7,437 Oct-23-2020, 10:41 PM
Last Post: ATARI_LIVE
  [Tkinter] Unable to get current contents of the entry field where the content is the file path pmpinaki 1 2,223 Apr-18-2020, 06:45 PM
Last Post: deanhystad
  [Kivy] AttributeError: 'NoneType' object has no attribute 'bind' faszination_92 2 6,267 Apr-12-2020, 07:01 PM
Last Post: Larz60+
  [WxPython] Bind error PeterLinux 1 2,242 Apr-06-2020, 03:07 AM
Last Post: joe_momma
  Tkinter:Unable to bind and unbind function with a button shallanq 2 5,029 Mar-28-2020, 02:05 AM
Last Post: joe_momma
  Transfer Toplevel window entry to root window entry with TKinter HBH 0 4,466 Jan-23-2020, 09:00 PM
Last Post: HBH
  [Tkinter] Accessing Entry with get Function nexgenskydiver 1 1,631 Oct-07-2019, 09:21 AM
Last Post: wuf

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020