formatting

This commit is contained in:
Christoph J. Scherr 2023-09-05 15:35:03 +02:00
parent 07f2a5d728
commit 2e23190dfe
1 changed files with 7 additions and 16 deletions

View File

@ -244,8 +244,8 @@ The text is large, read it [here](data/metasyntactic.md) and find the raw text f
1. Use a regular expression (regex) to find all instances of a lowercase character with a 1. Use a regular expression (regex) to find all instances of a lowercase character with a
following vowel character, in which no 'x', z' or 'y' follows the vowel in the given Text. following vowel character, in which no 'x', z' or 'y' follows the vowel in the given Text.
It is not allowed to store the text in a variable, you must load it from an outside source, such as It is not allowed to store the text in source code, you must load it from an outside source,
a file. such as a file.
Examples: Examples:
@ -258,28 +258,19 @@ Examples:
| bAR | yes | | bAR | yes |
| far | yes | | far | yes |
A hint that you don't want to miss: use [regex101.com](https://regex101.com) if you are not already A hint that you don't want to miss:
a REGEX expert.
Use [regex101.com](https://regex101.com) if you are not already a REGEX expert.
<details> <details>
<summary>Hints</summary> <summary>Hints</summary>
- Use `http.server.SimpleHTTPRequestHandler` and `io.BytesIO`. TODO
- Define your own class that inherits `SimpleHTTPRequestHandler`.
- You don't need to implement `do_GET()`.
- Implement your own `send_head()` method. This is the method that writes your response (not
completely on it's own, but unless you feel like inspecting standard libraries, just do what
I'm saying.).
- `send_head()` should take no arguments (other than `self`) and return some readable buffer.
- Don't forget to set the headers for HTTP before sending the body.
- Your OS might block hosting to ports < 1000. Try to host your web server to `localhost:8080`.
</details> </details>
<details> <details>
<summary>Solution</summary> <summary>Solution</summary>
Take a look at the provided Code Example. TODO
[Code Example](src/miniweb.py)
</details> </details>