There are various GUI frameworks/toolkits that add features to/extend the python language.[1] (vs. implementing one's own)
GUI design tool provides a simple way to get started. aka use gui design tool to build gui, then examine the source code. NICEGui demo[2]
Bit advanced for request, but the framework/toolkit documentation / source code could provide some ideas on what's needed for / how to build a framework/toolkit. (and/or just simple box with border & text prompt)
----------
[1] : Python GUI toolkits : https://wiki.python.org/moin/GuiProgramming
-------
Python Tkinter GUI Design Using ttkboostrap - Complete Course : https://www.youtube.com/watch?v=0tM-l_ZsxjU
Tkinter Beginer Course - Python GUI Development : https://www.youtube.com/watch?v=ibf5cx221hk
Python tkinter full course for free : https://www.youtube.com/watch?v=TuLxsvK4svQ
-------
EasyGui tutorial : https://easygui.sourceforge.net/tutorial.html
-------
NiceGUI documentation : https://nicegui.io/documentation (examples related to request : https://nicegui.io/documentation/section_page_layout )
NiceGUI related intros:
Python - NiceGUI Introduction : https://www.youtube.com/watch?v=jGgdec_d0PI
NiceGUI Python Crash Course : https://www.youtube.com/watch?v=B-45Ps3ZGzc
NiceGUI For Beginners: Build An UI to Python App in 5 minutes : https://www.youtube.com/watch?v=tfBKRxbCsao
Getting started with NiceGUI in Python. Run in a window : https://www.youtube.com/watch?v=RfQ522ReHTo
How to make HTML GUIs in Python with NiceGUI : https://www.youtube.com/watch?v=gyscrrS4hEA
--------FastUI & Pydantic - Build Interactive UIs with Declarative Python code : https://www.youtube.com/watch?v=eBWrnSyN2iw
--------