This is a little bit of boilerplate code for a Python script.
Read more…Home / python
Boilerplate of a Python script
CLI prompts
Some shortcuts to asking various questions on the command line.
Read more…Fetching online data
The snippets below show how to download a binary file, and how to fetch and parse JSON.
Read more…File I/O in Python
Quick copy-pasteables for writing and reading files in Python.
Read more…Files and folders
Various methods to copy, delete and create files and folders. Inludes methods to move files and folders to the trash bin instead of deleting them.
Read more…Handling JSON
Converting Python dictionaries to and from JSON is easy with the json
package.
Reading properties from an environment file
Using the dotenv
package we can easily load properties from a .env
file: