This is my personal notes where I keep Python snippets & examples I've ever found useful during day-to-day programming. Not just Python snippets, now I also keep a note on Go
Source: https://stackoverflow.com/questions/2654113/how-to-get-the-callers-method-name-in-the-called-method import inspect def f1(): f2() def f2(): ...
Need to know height and width in advance · package main import "fmt" func main() { height := 6 width := 5 foo := make([][]int, height) ...
OOP in Python · Source: https://realpython.com/python-getter-setter/ A simple example # employee.py from datetime import date class Employee: def...
Easy peasy import json to_dict = json.dumps(json.load(ordered_dict))
My daily Python snippets · A case of extracting the diff of 2 dicts in Python # DICT DIFF EXAMPLE data = { "fee": 1, "fi": 2, "fo": 3, ...
My collection of Python snippets · I found this on (hmmm certainly) StackOverflow 😊 # Dynamic property for a class class ExampleClass(): def...