Collection of guides and code to print "Hello, World!" to different places.
The goal is to create simple examples of usage for different tools and libraries so that the function is isolated. This can hopefully be used to better understand core functionalities of these tools.
- The program should only output hw to the specified place.
- The program should do only the minimal neccesary amount of setup for the task at hand.
- The program should follow as much of the PEP style guide as possible.
- It should be very clear, if the program ran correctly or not. So do not write to files you have read from.
- The tasks should be somewhat challenging and not copy the whole documentation of the used libraries as such. The goal is not to use every method available to throw around greetings, but rather to provide barebone structure to build upon.
- All the steps taken should be isolated in code and properly explained. This is a learning project.
- Every task requiring particular environment should contain a readme file and information resources used should be linked in this file.
- All tasks or at least task folders should be linked in this document and briefly explained.
- Do not be afraid to break rules if it helps teaching others better.
Sort of a table of contents for the different experiments. I am using hw as a shortcut, because this would be a lot of writing otherwise.
Hello, World!
- hello_world.py - printing to console
- Logging - Examples of using logging module
-
Python
-
The first one
-
Files
- Output to file
- Take filename as parameter
- Read from a file
- Set to an ENV variable
- Read from ENV
- Output to file
-
Packages
- Print hw returned from a function in a different module
-
Modules
- Using logging module
- Write to JSON
-
Network
- As a server request using requests module
- Get hw from endpoint
- Post hw to endpoint
- As a server request using httpx module
- Send in an E-mail subject
- As a server request using requests module
-
Async
- Using async function
- As a async server request using async httpx module
- Async to a file
-
-
HTML
- A passive web page containing hw:
- In the title
- In the body
- A pretty version
- In a SVG canvas
- A passive web page containing hw:
-
Flask
- Respond to a request:
- With plaintext hw
- With HTML hw
- Loaded from a file
- With a JSON object
- If it is properly authorized with a JWT
- Respond to a request:
-
Docker
- A Docker container responding with one of the Flask examples