This is all you need to do to create a function to ask something to the user with python and tkinter:
import tkinter as tk
from tkinter import simpledialog
def input_text(
title="Title",
prompt="Question",
feedback="ok"):
tk.Tk().withdraw()
name = simpledialog.askstring(title, prompt)
print(feedback.format(name))
if __name__ == "__main__":
input_text(
"Question",
"What is your name?",
feedback="So your name is {}!")

Subscribe to the newsletter for updates
Tkinter templatesTwitter: @pythonprogrammi - python_pygame
Claude's Games
1. Memory gameVideos
Speech recognition gamePygame's Platform Game