Skip to content
Snippets Groups Projects
Commit 3381638c authored by joshmk31's avatar joshmk31
Browse files

basic text box

parent c080ef59
No related branches found
No related tags found
No related merge requests found
import tkinter as tk
def on_submit():
user_input = text_box.get("1.0", "end-1c")
print("User entered:", user_input)
# Create the main window
root = tk.Tk()
root.title("Text Box Input")
# Create a Text widget
text_box = tk.Text(root, height=5, width=40)
text_box.pack()
# Create a Button to submit text
submit_button = tk.Button(root, text="Submit", command=on_submit)
submit_button.pack()
# Run the application
root.mainloop()
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment