These are the current filters.
If you want an array in random order, you can use the sample
filter to get a random sample of the same size as the original array.
When you make an HTTP request, you can use the If-Modified-Since
header to get a 304 Not Modified if nothing has changed since your last request.
open
command can ask questions If you pass an argument that can’t be easily identified as a file or a URL, open
will ask you what to do next. This may be a surprise if you were trying to use it in a script.
Why I use Sessions in boto3, and the Python function I use to create them.
{% raw %}
tag to describe Liquid in Liquid If you’re trying to write about using Liquid tags in a Liquid-based site, wrapping your tags in the {% raw %}
tag will prevent them being rendered.
{% capture %}
tag to assign complex strings to variables If you want to get a string that’s semi-complicated to construct, you can put a “mini-template” in the {% capture %}
tag to build it over multiple lines.
By reading the code for the pytest-random-order
plugin, I was able to write a new plugin that runs a random subset of tests.
You can use sqlite-utils on the command line to create a SQLite database from a CSV file.
The sqlite3.connect(…)
context manager will hold connections open, so you need to remember to close it manually or write your own context manager.
If you add /podcast
to a Tumblr site, you get a podcast-like RSS feed for all the external audio posts on that site.