Wednesday, August 21, 2013

What To Know About Python: I. Windows Environment

Recently I took a terrific Coursera online course from the University of Melbourne on Discrete Optimization, led by Professor Pascal Van Hentenryck with teaching assistant Carleton Coffrin and team. I highly recommend the course to anyone wanting to learn Discrete Optimization - it presents classical optimization problems with lively videos, many-sized problems and superb graphics.

Professor Van Hentenryck's introductory video to Discrete Optimization

I achieved my goal of upgrading my skills, but sadly failed the course, in part because I needed better Python programming skills. So I'm going to devote some blog pages to what it would have been useful to know before doing the course.
CodeAcademy is a great place to start learning Python. It gamifies learning with short little examples and helps you learn about lists, dictionaries, tuples, as well as for, while and if statements. I did a little each morning.
It's useful to look at the official documentation,  which includes Tutorial, Library Reference and Language Reference.  If you use Google to search for information about Python, chances are it will find the Tutorial, which is useful when you are starting out, but you will quickly outgrow it. So the Language Reference has more detailed information.
I used Windows as my development environment. I started with the IDLE development environment. It provides an editor, a Python Shell and a rudimentary debugger. At the end of the course I found Spyder - the Scientific PYthon Development EnviRonment, which also has these features, but can show you code structure, objects in a more complete Interactive Development Environment (IDE). I wish I'd used Spyder.  Our course recommended Python 2.7, which you can download (different from Python 3). Windows version 2.7.5 came out in May 2013.  You can find Python for many different platforms, including MS-DOS and BeOS too.