str.format¶
An exception will be thrown if the value for a key in the string is not specified, which means that you must specify values for all keys. However, it is OK if you specify values for keys that do not exist in the string. That is you can specify values for more keys than needed.
Implement Singleton in Python
Tips and Traps¶
- Module is a good alternative to singletons in Python.
Programming in Shell
String¶
Regular Expression Comparison¶
https://stackoverflow.com/questions/229551/how-to-check-if-a-string-contains-a-substring-in-bash
Bash Programming¶
- case ... esac is different from switch(){} in C/C++. You do not have to return/exit manually after each branch.
not condition
if [ ! -d "$1" ]; then
fi
Shell Programing Trick¶
Generate 00, 01, ..., to 25.
for i in {00..25}; do echo $i; doneor
seq -f %02g 0 25
Shell Scripting¶
Enum in Python
Things on this page are fragmentary and immature notes/thoughts of the author. Please read with your own judgement!
Comments¶
- You must assign a value to each enum member.
Tips on Podman
Things on this page are fragmentary and immature notes/thoughts of the author. Please read with your own judgement!
https://github.com/containers/buildah A tool that facilitates building OCI images