The card I gave myself today says “Read Python language docs until I have written down 10 new things.” Why? Somebody pointed out that var = val or '-' was cleaner than the mess I used instead, and I realized that much more effort is required. (Were it Perl, I’d probably …
Articles in the Python category
Is a script to run a command within a virtualenv missing from virtualenv?
Sometimes the python command in the virtualenv isn’t quite enough.
Contents of script run_with_env.sh:
#!/bin/sh envdir=$1 shift curdir=$1 shift . $envdir/bin/activate && cd $curdir && exec "$@"
This runs a specified command (plus arguments) in a particular directory within a particular virtualenv.
Example use:
$ crontab -l ... 30 …
Analysis of user agent strings in Python to check for SNI capability
Very nice presentation on Python iterators and generators