Page 1 of 1

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

Posted: Tue Jul 12, 2022 8:22 am
by answerhappygod
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 1
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 1 (129.86 KiB) Viewed 54 times
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 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.