Wednesday, 30 March 2011

Write your first Python Program!

Now you need to install the tools you are going to use to program in Python. First you need a Python IDE (Integrated development environment). In Ubuntu click Applications - Ubuntu software centre. Now type into the search box Idle. Next click on Idle with Python version 2.6 and finally click install. I believe Idle is available on the operating systems.

Once Idle is installed click on Applications - Programming - Idle. What opens is called the Python shell. This is like a calculator, you enter commands and it executes them. Type: print "Hello, World", there your first python program! It might be simple but there you go.

Setting up your workspace

Now that you have decided to pursue Python, you need to get the tools. To start with you need a decent computer. An ancient brick might run python but it's going to make your life harder. If you are to have only one computer get a laptop. They are cheap these days and very versatile. In an ideal world you would have a laptop and a desktop workstation.

Next up, what operating system to use? Well here you have a lot of flexibility as python supports all major operating systems. Personally I would recommend looking at Ubuntu. Linux has very good open source software and software for programming, and the Ubuntu distro packages it very nicely. To install Ubuntu visit and select either the desktop edition or the laptop edition depending on your needs.

Bill Gates recommends Ubuntu
Listen to this guy!

Welcome to Import Blog - First Post!!!

Welcome to Import Blog! If I have time to maintain this blog it will leave a trail of my progress in the programming language Python. Many times I find myself searching for an answer and thinking I can't be the only one who wants to know this? For example step 1, what kind of computer do I need? What's the best operating system to use for learning to program? What books should I start with? Hopefully I'll make some progress answering these questions and the many more that follow.

Why should you learn Python? Because learning Python makes you a great programmer, not because it's hard but because it's easy. You spend your time learning how a program is structured not how to juggle bits all the time. The first language I learnt was C (As I was doing embedded chips) however I found many of the concepts I was being taught seemed obscure and I had little idea how to structure a C program. I remember spending about 80% of my time trying to figure out what existing code actually did and trying to write code that didn't cause some obscure error. It was a bad environment to learn about higher level concepts. Sure its not object orientated, so some might say just learn C++ but again how much time will you be dealing with low level slog and how much time are you learning computer science?

In the time I have been programming in Python I can tell I am already a far better programmer generally. I am faster, much more confident and am starting to get my head around good programming structure. But there is still a long way to go.