Using the dotenv
package we can easily load properties from a .env
file:
All snippets tagged with python
Page 1 of 1Reading properties from an environment file
Handling JSON
Converting Python dictionaries to and from JSON is easy with the json
package.
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…File I/O in Python
Quick copy-pasteables for writing and reading files in Python.
Read more…Fetching online data
The snippets below show how to download a binary file, and how to fetch and parse JSON.
Read more…Boilerplate of a Python script
This is a little bit of boilerplate code for a Python script.
Read more…CLI prompts
Some shortcuts to asking various questions on the command line.
Read more…