Saturday, 13 February 2010

python3 basics

I discovered a couple of gotchas in getting python3 up and running in Ubuntu 9.10 (and probably Lenny and Squeeze as well).

Install python3.

Install python3-tk. (This one is easy to miss.)

Add to source files:

#!/usr/bin/python3

To invoke, at the command line do

$ python3 foobar.py

Geany’s F5 doesn’t work because it makes compile and execute calls using python rather than python3. I am loathe to change it at this point because it may wreak havok on python2.6 stuff.

As potential alternatives there are idle-python3.0 and idle-python3.1 packages, which I will be evaluating todayish.

Add comment

Fill out the form below to add your own comments