Posts Tagged ‘python’

How I Learnt Python

2015-09-25

Judging from the people at PyCon UK that I spoke to, there was quite a lot of interest in learning Python. This is all good and to be expected. Not only are conferences a good place for the Python-curious, this conference had the Trans*Code, DjangoGirls, and the education track, all aimed at people who had never programmed in Python before.

ZX81 Basic Manual

ZX81 Basic Manual

Several times I got asked, “So, how did you learn Python”. How I learnt Python was that I learnt Sinclair BASIC from Steve Vickers’ ZX81 BASIC Programming when I was about 10 years old. A combination of a wobbly RAM pack and unreliable tape means you get good at typing programs in. Then I learnt a bit of Zilog Z80 machine code and wrote my own assemblers, and dabbled in FORTH. At sixth form I got an Atari ST, and I learnt Motorola 68000 assembler and started to dabble in C, Lisp (XLISP), more FORTH, and extensible text editors (MicroEMACS). At university I found C, more Lisps (Cambridge, Acorn, Common), more extensible text editors (the wonderfully charming and parochial ZED and E), scripting languages (WREN, lol), and a bit of ML. Towards the end of university I started to learn about Unix and ed, sed, vi, emacs, and awk. After that I got a job as a C programmer and learnt a lot more C and bit about the SPARC, UltraSPARC, MIPS, and ALPHA architectures. As well as more Unixes, and a bit about Windows NT, and Dylan. Java appeared on the scene (and I did write one small program in it). After that I learnt Lua. And then, eventually, Python. As you might imagine, at this point, learning Python is rather easy. There is almost nothing new in the language except for the indentation.

So my answer to the question is not very useful. Most people who ask the question want to know “how should they learn Python?”, and how I learnt Python is clearly not how they should learn Python. I’m not really sure I have a good answer, even though I’ve been involved in teaching it (at Software Carpentry, and with John Pinner at a PyCon). Python has an official tutorial, and I used that a long time ago and thought it was not bad. I’ve heard some fairly lukewarm responses from other beginners though. Software Carpentry is good, but not very frequent unless you want to travel a long way (and it is somewhat targeted at the scientific post-doc). I’ve never tried any of the MOOCs. I’ve seen someone go through many Python koans, but it didn’t seem to help them learn Python any faster than any other way. DjangoGirls had a very positive response at PyCon UK, and not only teaches Python from scratch but also Django, so you can make a useful website.

A buddy will help. A concrete goal will help, I love to quote Nardi:

“People are likely to be better at learning and using computer languages that closely match their interests”

Bonnie Nardi, “A Small Matter of Programming”

So if you like cycling write an app to calculate your favourite gear ratios, if you like climate science, try recreating the global historical temperature change.

If you haven’t learnt Python yet, how are you planning to? If you’re learning Python, how are you doing it? If you know Python, how did you learn it?

Advertisements

Return to PyCon UK

2015-09-20

PyCon UK 2015 is the UK’s Python conference. Held again in Coventry. I didn’t go last year, in fact I have missed a few years and this has been my first PyCon for a while.

This year we are without John Pinner. I was sad to hear of his death earlier this year. John brought me to the Python community. When I turned up to the first PyCon UK way back in 2007, 10 minutes before I was due to give a talk, John made me immediately feel welcome. The efforts of John Pinner and The Committee have always made PyCon UK a rewarding and invigorating experience. I’m drinking from the very splendid conference mug, which has a lovely quote from John Pinner back in 2006, before the first PyCon UK:

What we really need to do is set up a UK Python conference.

Thanks John.

PyCon UK 2015

For me the conference is about the community: the people attending, the committee, the “do”-ocracy spirit. Conferences can be stressful on a personal level what with new places, hundreds of people you don’t know, strange food. It didn’t take me long before I was relaxing a bit and chatting to new friends. I think the Python community is very welcoming, I know I’m not the only one who thinks that, and I hope everyone attending is able to share that spirit.

It was pleasing to see old friends (all a bit older!), and very pleasing to make new ones, particularly the Python Ireland people enthusing about the upcoming PyCon Ireland. Yet again there was not enough time to meet all the interesting people that I wanted to, but I think that will always be true.

One of the more endearing memories for me was when the daughter of Zeth, in a moment of inspired parenting, manged to get the microphone in the plenary session and was merrily shouting “MAC ADAPTER! MAC ADAPTER!”, clearly pleased to the moon and back to get the attention of 400 or so PyCon UK attendees :).

Thanks to the committee and the volunteers, past and future!

Python and bragging about C89

2008-10-02

People who brag about how cool and modern they are to require a C89 compiler (that’s you Python 2.6) should not be using // for comments. Maybe they meant they require a C99 compiler.

And yes, this really matters. On AIX 6.1 the Python 2.6 configure script selects a C89 compiler («cc_r -qlanglvl=extc89» if you must know). Which barfs on their warthog creating code.

Meh. Maybe I’ll even file a bug report.