So this is the first post in a short series for the Naas-Sallins Coder Dojo about using the Python programming language. It is aimed at the people who have got pretty familiar with scratch and are looking to try something new. There are a ton of python resources on the web and I will list some of these later.
Step 1. Get Python
unless you are on Linux chances are that you will need to install python. At the moment python has 2 major versions 2.7 and 3.3 which have some real differences. I recommend for our purposes that you download and install the 2.7 version for your operating system from ActiveState as it comes bundled with some good help files an editor and documentation. If your install asks if you want to let python through your firewall select yes since we will use this feature later.
Step 2. Hello World
Okay so now lets check that python is installed correctly. It’s pretty much a standard to do ‘Hello World’ when starting any new programming language. The idea is to confirm that you have everything installed correctly by writing the code to print out the message ‘Hello World’. If you are on windows and have a start menu try running the Python Interactive shell from the ActiveState Group or you can type python from a command shell.
You should get something like this
ActivePython 184.108.40.206 (ActiveState Software Inc.) based on
Python 2.7.5 (#65, Mar 30 2005, 09:33:37 [MSC v.1310 32 bit (Intel)] on
Type “help”, “copyright”, “credits” or “license” for more information.
You can use the Python shell to interactively run Python code, so in our case at the >>> prompt type
print “Hello World”
If you get
congrats you have python installed! If something went wrong along the way don’t worry, I will give you a hand at the next dojo session.