Archive for November, 2011

C++ (just for a bit of fun, back to Python later).

30/11/2011

Okay, I know I should try to stick to one thing, but you know how it is. You get reading about computer languages and then, the next thing you know, you’re saving a file with a .cpp extension and getting all excited watching it compile. This is just a little bit of code I copied out of a book that does the area of a rectangle. Cute though. And I can’t seem to stop myself posting up screenshots from my sexy little laptop!

antiloquax

(now, where did I put that book on HTML …?)

Advertisements

Start Programming

30/11/2011

Okay, I am assuming you have installed Python on your computer.

There are many good free tutorials available on the internet (eg. A Byte of Python and Dive into Python).

However,  I thought it would be helpful to do some basic stuff here to get us started.

1) Hello World

First open the Python IDLE – probably by going:

Start – All Programs – Python – IDLE.

This opens up the “interpreter” (or Python Shell) – you can just type Python commands in and it will do them immediately.

The cursor will be blinking at this prompt:

>>>

Type:

print(“Hello world.”)

When you press “enter”, it should display: “Hello World.”

2) Writing a program

That’s nice, but it isn’t a program yet. To do that we need to open the “editor”. From the file menu, select: “New Window”.

The editor will pop up. Now save this file as: “Hello World.py” (you might want to make a folder for your programs at this point). You have to save the program before you can run it, and it makes sense to do that first.

The cursor is now blinking in an empty box.

Type:

print(“Hello World.”)

Now save the file again (ctrl-s is quickest) and run it (F5 will do this).

The interpreter will open up a new window and display: “Hello world.”, just as it did before.

Congratulations – you are now a computer programmer!

Check back for your next lesson later!

antiloquax

Coding is the new Latin

28/11/2011

On Radio 4’s Today programme this morning, they mentioned this slogan, invented by Alex Hope (one of the authors of the Next Gen review).

You can read an article about the importance of teaching young people to code here.

There’s also an article about the Next Gen report that you might find interesting here.

Also, there was a bit on this evening’s PM. Follow this link and go to about 52mins in.

The Guardian (on Monday 28/11/11) also published this article on the subject.

30/1/11 EDIT: Just found another really good blog post from the Guardian’s Games section. It’s here.

antiloquax

Python3 in action

27/11/2011

This is a screen-shot of my laptop. It’s got a program open that asks the player to guess a number from 1 – 100. After that the computer makes a guess and asks if the answer is higher or lower or the same as the guess. When the computer gets the answer, it tells you how many attempts it took. It’s quite a simple program. I wrote this myself – it was one of the tasks in the book on Python that I am reading.

antiloquax

Try out Linux

27/11/2011

If you want to use the Raspberry Pi computer, you are going to need to learn a bit about Linux.

Basically, Linux Distributions (or “Distros”) are free, open-source, operating systems.

You can run them from a DVD, CD or USB. You can also install them alongside Windoze on your PC. At home, I have an ancient laptop running Wary Puppy (a great distro for older machines) and a dual boot Windoze / Debian set-up on my PC.

The easiest way to get started is to download the .iso file for the latest Fedora distribution. You then need to burn the .iso to a CD. Then, when you boot up your computer from the CD, it will go into Fedora (without doing anything at all to your Windows installation). You can have a play with it and see what you think.

Linux distros usually come with Python built-in (although it will usually be Python 2; installing Python 3 is pretty easy though). If you have your own computer, you might want to install a Linux distro alongside Windows and use that to practice programming.

Linux is faster than Windows, isn’t vulnerable to viruses and won’t fragment its drives. And that’s just three ways it’s better than Windows!

antiloquax

Raspberry Pi

27/11/2011

This is really exciting.

It’s a new computer that is really cheap (about £23). It’s been developed specifically to encourage young people to get interested in computers, especially programming.

It is expected to be available next month (December 2011). You can find out more here.

It will use Linux as the operating system – it will probably come with a version of Fedora. I think it’s a good idea to have a play with Linux. I’ll do a separate blog post on this later.

Click here  to listen to a good report on the Raspberry Pi from the BBC’s “Click On” programme.

If you are itching to get hold of a Raspberry Pi, this article will be right up your street.

antiloquax

Welcome

25/11/2011

I am writing this blog to support students at the E-Act Academy who want to learn to program in Python. The Programming Club will be up and running very soon.

First, here are some places where you can get software and information.

To download the language, you need to go to this page.

Please download the most recent version of Python 3 (Python 2 was quite different, so it will cause errors if you try to run the code we will be writing with the older version).

I am using this book: Python Programming for the Absolute Beginner.

All the programs in the book can be downloaded free here.

There’s a nice free tutorial called A Byte of Python. The link points at the pdf file.

That’s all for now.

antiloquax

(Team Python)