Feb-10-2023, 03:19 PM
(This post was last modified: Feb-10-2023, 03:19 PM by Gribouillis.)
No I mean a UI in a web browser such as this one for example, created with the help of the bottle tutorial. Start the program in a terminal, then open
http://localhost:8080
in the web browserfrom bottle import route, request, run def search_form(): return ''' <form action="/search" method="post"> Search: <input name="search" type="text" /> <input value="Search" type="submit" /> </form> ''' @route('/') @route('/search') def search(): return search_form() @route('/search', method='POST') def do_search(): search = request.forms.get('search') return f''' {search_form()} <h3>Results</h3> <ul> <li>spam {search}</li> <li>ham {search}</li> <li>eggs {search}</li> </ul> ''' run(host='localhost', port=8080, debug=True)