Tech and travel

Posts

A one line webserver

2008-03-03

Python has a built in webserver, that shows the contents of the directory it’s started in. Here’s how you run it : python -c "from SimpleHTTPServer import test; test()" This is invaluable if you have to copy some files across to another machine. It won’t work across the internet, but on a local network it can’t be beat. Yesterday I had to move a 2.4 Gig ISO file from the laptop PC to my Mac.

Using YAML in Python

2008-02-18

YAML, which stands for ‘YAML Ain’t Markup Language’, is basically XML without < and > . This makes it very readable. Additionally, in dynamic languages such as Python, the data in the file will be loaded as a Python data structure. Here’s an example file : http://www.infoworld.com/rss/news.xml: (1970, 1, 1, 1, 0, 0, 3, 1, 0) http://weblog.infoworld.com/udell/rss.xml: (1970, 1, 1, 1, 0, 0, 3, 1, 0) http://weblog.infoworld.com/techwatch/rss.xml: (1970, 1, 1, 1, 0, 0, 3, 1, 0)

Stonehenge

2008-02-09

Near Salisbury, in the county of Wiltshire in England, lies Stonehenge.

Detail

Detail

Creating PDFs using Python

2008-02-06

ReportLab has a library for generating PDFs from Python. The following example will show how a PDF can be created using this library. The PDF will contain a title and a table. The first part of the script imports a few of the reportlab objects and sets up a few variables for stuff like titles. from reportlab.platypus import * from reportlab.rl_config import defaultPageSize import reportlab.lib.colors from reportlab.lib.units import inch PAGE_HEIGHT=defaultPageSize[1] Title = "Bill"

Countries visited

2008-02-04

Here are the countries I’ve visited so far :

Copyright (c) 2026 Michel Hollands