Check out this topic. This probably has what you need.
GUI textfield example
https://forum.omz-software.com/topic/3609/gui-textfield-example
There's also a good example in the last post in this thread:
Basic UI Question
https://forum.omz-software.com/topic/3503/basic-ui-question
These other topics have useful information.
textfield validation example
https://forum.omz-software.com/topic/2499/textfield-validation-example/2
Ui.textfield drives slider
https://forum.omz-software.com/topic/3051/ui-textfield-drives-slider/8
Pre fill Textfield
https://forum.omz-software.com/topic/2379/pre-fill-textfield
Plotting on a single screen with text fields
https://forum.omz-software.com/topic/1665/plotting-on-a-single-screen-with-text-fields/7
How to set focus to textfield (2)
https://forum.omz-software.com/topic/1453/how-to-set-focus-to-textfield-2
How to set the focus on a TextField?
https://forum.omz-software.com/topic/955/how-to-set-the-focus-on-a-textfield/4
Tell cursor position in a TextField?
https://forum.omz-software.com/topic/1442/tell-cursor-position-in-a-textfield
How to reference textfield
https://forum.omz-software.com/topic/863/how-to-reference-textfield
Button + Textfield Saving to Variable
https://forum.omz-software.com/topic/848/button-textfield-saving-to-variable
about 'TextField'
https://forum.omz-software.com/topic/740/about-textfield
I used the "Search" feature above to find these last few topics, but the first one I found using Google. I searched for "Pythonista TextField example" without the double quotes. That lead to this forum.
I'd have given an example myself, but while I've written several Pythonista programs now, I still haven't used a TextField. I learned a lot searching for this! Good luck.