Month: <span>December 2001</span>

I’m trying to read some Python code today, and I ran into something I don’t understand. What does the following mean in Python?:

x = [0] * (2 * 2)

If I understand correctly, the value of X after that line executes will be:

[0, 0, 0, 0]

…but I’m not sure. My brain doesn’t know how to parse multiplication of a dictionary object (yet). I’m sure that somewhere on python.org, there are docs about this, but I haven’t found them yet. Anyone know the answer?

Jake's Brainpan

Comments closed

I have an admission to declare: Every time I see DayPop, my brain says “Day-Poop”. I wonder what would Freud say?

Jake's Radio 'Blog

Comments closed

Here's how to get the current time into your page, in a 24-hour format, European-style — add the following macro to your template:

<%<br /> local (day, month, year, hour, minute, second);<br /> date.get (now, @day, @month, @year, @hour, @minute, @second);<br /> hour = string.padWithZeros (hour, 2);<br /> minute = string.padWithZeros (minute, 2);<br /> second = string.padWithZeros (second, 2);<br /> return (hour + "." + minute + "&apos;" + second)<br /> %>

The macro expands to something like this: 03.36'02

Jake's Radio 'Blog

Comments closed