#๐Ÿ”’ How can I link the link reader function to my entry text box

4 messages ยท Page 1 of 1 (latest)

tough pulsar
#

this is the code:
import tkinter
from tkinter import *

window = Tk()
window.geometry("1240x500")
window.title("Link Reader")

File = open("Criterion B - fake list document.txt", "r")
File_content = File.read()
File.close()
user_input = input("Enter Site: ")

def link_reader():
if user_input in File_content:
print("Fake Site")
else:
print("Valid")

label = Label(window, text="Link Reader" )
label.place(x=0, y=0)

verify_button = Button(window, text="Verify Link")
verify_button.pack()

entry_field = Entry(window, font=("Arial", 40))
entry_field.pack()

window.mainloop()
This is practically my first time creating GUI in tkinter so how can I link my link reader function to the text box, then how do I make the link reader function start only after clicking a button to run it?

wet questBOT
#

@tough pulsar

Python help channel opened

Remember to:

  • Ask your Python question, not if you can ask or if there's an expert who can help.
  • Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
  • Explain what you expect to happen and what actually happens.

:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.

wet questBOT
#

@tough pulsar

Python help channel closed

This help channel has been closed and it's no longer possible to send messages here. If your question wasn't answered, feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.