Cookbook
Python
Collection of Python code recipies.
Display Python version
Display Python version in the current notebook.
Get current time
Get and display current time in Python
Get working directory
Get and display current working directory in Python
Get environment variable
Access environment variable in Python
Add .env variable
Add environment variable in Python
Load secrets from .env
Load secrets from .env file to environment variable
Random integer
Generate random integers in Python
Time delay
Add time delay in Python
Check if file exists
Check if file exists in Python without raising Exception
Read file
Read file in Python
Write to file
Write to file in Python
Append to file
Append to file in Python
Delete file
Check if file exists and if yes, then delete file
Copy file
Copy file in Python
Delete directory
Check if directory exists and if yes, then delete it
Read JSON from file
Read JSON file to dict in Python
Write JSON to file
Save JSON object to file in Python
Pretty print JSON
Pretty print JSON in Python