Python and micropayments
13th March 2003
Fredrik Lundh has started posting his book The Standard Python Library online, in response to O’Reilly’s decision not to publish a second edition of the book. I’d never read it before, but having sampled the first two chapters I’m hooked. It works a bit like a “cookbook”, with a plethora of code samples explained in detail accompanied by tips and tricks relating to the language. The Lazy Import class, which loads a module only when an attribute of the module is called for the first time, is a classic example:
class LazyImport: def __init__(self, module_name): self.module_name = module_name self.module = None def __getattr__(self, name): if self.module is None: self.module = __import__(self.module_name) return getattr(self.module, name) string = LazyImport("string") print string.lowercase
Frederick plans to release a chapter every Friday until the whole book has been posted. Alernatively, you can buy the whole 1999 edition from him as a PDF file for the princely sum of $5.00, which works out at £3.18 in GBP via PayPal.
I think that was my first ever micropayment.
More recent articles
- Weeknotes: Llama 3, AI for Data Journalism, llm-evals and datasette-secrets - 23rd April 2024
- Options for accessing Llama 3 from the terminal using LLM - 22nd April 2024
- AI for Data Journalism: demonstrating what we can do with this stuff right now - 17th April 2024
- Three major LLM releases in 24 hours (plus weeknotes) - 10th April 2024
- Building files-to-prompt entirely using Claude 3 Opus - 8th April 2024
- Running OCR against PDFs and images directly in your browser - 30th March 2024
- llm cmd undo last git commit - a new plugin for LLM - 26th March 2024
- Building and testing C extensions for SQLite with ChatGPT Code Interpreter - 23rd March 2024
- Claude and ChatGPT for ad-hoc sidequests - 22nd March 2024
- Weeknotes: the aftermath of NICAR - 16th March 2024