/explore

Click through on any links that interest you or select the planets on the right to continue exploring the Outer Web.
You are here

alexwlchan.net
| | techtldr.com

Here is a simple trick that I used to restart my python script after unhandled exception. Let's say I have this simple script called test.py that I want to run forever. It will just wait 2 seconds and throw an error. I use the following script called forever in the same directory: It uses python [...]
3.5 parsecs

Travel
| |
| | til.simonwillison.net

I figured out how to run a subprocess with a time limit for datasette-ripgrep , using the asyncio.create_subprocess_exec() method. The pattern looks like this:
2.5 parsecs

Travel
| |
| | fuzzyblog.io

[AI summary] The author discusses differences between Python and Ruby regarding dictionary key access and missing keys, highlighting cultural design philosophies and the Pythonic .get() method.
3.6 parsecs

Travel
| |
| | inventwithpython.com

A recent post to Reddit sparked some comments, so I wanted to clarify: In Python, hashable objects must be immutable and mutable objects cannot be hashable. (With one exception.)
26.2 parsecs

Travel
|