1. Text Server (1 mark) Setting up: 1. Create your file text_server.py . 2. At the top of the file (above your import st
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am
1. Text Server (1 mark) Setting up: 1. Create your file text_server.py . 2. At the top of the file (above your import st
question for any students who would like it. ► 1. Set up your Flask app. ► 2. Create a function for each route. Update the routes, function names and HTTP methods for each copied function. ►3. For each route, write code to produce the HTML. ▸ 4. Implement additional functionality. ► 5. Test your application works.
1. Text Server (1 mark) Setting up: 1. Create your file text_server.py . 2. At the top of the file (above your import statements), in a comment, include your name and student number. Task: Write a Flask web server that analyses text. On the main page have a textbox and a submit button. If the submit button is pressed, on the next page show an analysis of whatever was in the text box. This analysis should include the number of characters (including spaces and punctuation), the number of characters (excluding punctuation), and the number of words. Note: • All responses the server gives should be in HTML. It is recommended that you use this as an opportunity to familiarise yourself with HTML and PyHTML. • You may use the web servers implemented in lectures as a guide to structuring your code. Step By Step: This section guides you through the implementation of this