Python How to Program Tutorial Pt 1

Python How ToWelcome to the Python How to Program Tutorial. In a long series of articles, I will answer all of your Python questions. I’ve chosen to cover Python because I’ve received many requests pertaining to learning how to program with Python. I’ve also chosen to finally finish my automated website program with Python. By the end of this tutorial you’ll be able to:

  • Understand how to write Python programs
  • Use most of the built in functions provided with Python
  • Use Python to take any information on the web and use it as you see fit
  • Create a truly useful automated website that will attract a ton of traffic

I’m really challenging myself here, but it should be an interesting trip. Let’s get started.

Get your Python Programming Tools

Before we can begin, you need an IDE for programming in Python. I spoke about my favorite in Free IDE. I explain how to install Python on Mac’s and PC’s here, so that you don’t have to try and figure it out on your own.

Install Python on a PC

  • Go to to install Python
  • Click on Downloads
  • Click on the newest version of Python
  • Choose the version labeled Windows x86 MSI Installer
  • Run the Python Installer that you downloaded (Starts with python and ends with .msi)
  • Make a note of where Windows installs Python, on the screen labeled “Select Destination Directory”
  • Select the defaults for everything
  • After installation is complete, go to the folder you installed Python to and double click on the program called idle (If it opens, your installation is complete)
  • Install Java from, unless you already have it installed

Special Note: If you are getting a Java error when you try to launch Eclipse, follow these steps:

  • Locate the javaw.exe file on your computer
  • Copy the location of that file (Mine is C:\Program Files (x86)\Java\jre6\bin\javaw.exe)
  • Paste the following code in your eclipse.ini file (Locate it in the Eclipse Folder)


C:\Program Files (x86)\Java\jre6\bin\javaw.exe (Substitute the location of your javaw.exe file)

  • Install the Eclipse IDE from the Eclipse Download page
  • You want to install the Eclipse Classic IDE (It will automatically install the one best for your operating system)
  • Unzip the file you downloaded
  • Drag the Eclipse folder into the Program Files Folder
  • Double click Eclipse to run the program

Now you have to connect your Python interpreter to the Eclipse IDE, you just installed.

  • Inside of Eclipse click Help – Install New Software
  • Click on Available Software Sites and the Add button
  • Enter pydev in the Name field and in the Location field
  • Click OK
  • In the Available Software window, type pydev in the Work with field
  • Click in the checkbox, next to PyDev
  • Click Next
  • Click Finish
  • Restart Eclipse after the install completes
  • Click Window – Preferences
  • Click the arrow next to PyDev, on the left sidebar
  • Type Python 3 in the Name field
  • Type in the location of Python.exe, on your system
  • Click OK

Now it’s time to create your first Python project.

  • Click File – New – Project
  • Click on the Pydev folder – Pydev Project – Click Next
  • Give the project a name
  • Grammar version should be 3.0, as of this writing
  • Interpreter should be 3.1
  • Click Finish
  • Click Yes

Now set up the location for all of your Python code.

  • Right click on the name of the Python project, you just created in the left sidebar
  • Select New and browse to the location you want to save all of your code
  • Click Finish

Yeah, you have everything installed and are ready to go!


Install Python on a Mac

Here I’ll show you how to setup everything you’ll need to write Python programs on a Mac.

Install Python on a PC

  • Go to to install Python
  • Click on Downloads
  • Click on the newest version of Python
  • Choose the version labeled Mac OS X Installer Disk Image
  • Double click on the Python Installer, you just downloaded, that ends with .dmg
  • Double click on Python.mpkg
  • Click continue 3 times, Agree and then Install
  • If you double click on the application called IDLE, and it opens, Python is installed
  • Install the Eclipse IDE from the Eclipse Download page
  • You want to install the Eclipse Classic IDE (It will automatically install the one best for your operating system)
  • Double click on the Eclipse Installer, you just downloaded
  • Drag the folder, called Eclipse, into your Applications folder

Now I’ll show you how to connect Eclipse with your Python interpreter.

  • Start Eclipse
  • Click Help – Install New Software
  • Click the link Available Software Sites
  • Click the Add button
  • Type Pydev in the name field and in the Location field
  • Click OK twice
  • Type Pydev in the Work with field
  • Put a check in the checkbox next to the word PyDev
  • Click Next twice, Accept and Finish
  • Restart Eclipse

Now create a PyDev project, by following these steps:

  • In the upper right hand corner click on the little box with a plus sign on it (It’s next to the word Java)
  • Select the Other… option
  • Select PyDev and click OK
  • Click Eclipse – Preferences in the main menu bar
  • Click on the arrow head next to PyDev
  • Click Interpreter – Python
  • Click New
  • Click Browse and locate the Python Executable it’s in the bin directory and is named python3.1
  • Change the Interpreter Name to PyDev and click OK
  • Click OK
  • In the window in Eclipse called Pydev Package explorer right click
  • Click New – Project
  • Select the PyDev Folder and then PyDev Project
  • Give your project a name
  • Use Grammar version 3.0 and Python 3.1 for the Interpreter
  • Click Finish

Now to create a folder that will store all of your Python scripts:

  • Right click on the folder, that is named after your project
  • Click on New – Folder
  • Click the Advanced button and Link to folder in …
  • Browse to the location in which you’d like to save your scripts
  • Click open
  • Click Finish

Your First Python Program

Now that everything is installed, you can write your first Python program. Yeah! Right click on the folder you designated to store your Python scripts. Click New and then File. Type in the File Name field and click Finish.

Now type the following in the file that opens:


print(“Hello World!!!”)

  • Click on the Save icon in the main menu bar
  • Click on the Run icon as well
  • In the Run As window that opens click Python Run and then OK
  • In the bottom Console Window, you should see the words Hello World!!!

Yeah, you’ve installed Python and Eclipse and wrote your first Python Program.

Explaining the Code

In the following articles I’ll definitely create more complicated programs. Here I created this common Hello World program mainly to test that everything installed properly. Here is an explanation of the code.


  • This line of code notifies the operating system that is running it, of the location of the interpreter that can execute it
  • Since my code is made to be run on a Linux web server, I am providing the default location of Python on a Linux, or Unix server

In short, this line says “Hey operating system, here is some code to interpret and here is the location of the program that knows how to interpret this code.”

print(“Hello World!!!”)

  • The print function, in Python, will print to screen the string of characters contained between the braces ( ), and quotes “”.
  • You could also use the single quotes, if you’d prefer ‘ ‘

That’s All Folks

Well, now you have your software all installed and your ready to start programming in Python. I’ll of course provide tons of sample programs and videos along the way.

If you have any questions or comments, leave them below.

Till Next Time

Think Tank

15 Responses to “Python How to Program Tutorial Pt 1”

  1. developing developer says:

    which languages should i know to learn phython ?

  2. developing developer says:

    sory python*

  3. Omar Mora says:

    I just wanted to thank you. I am new to python and eclipse and spent most of the day trying to set it up. The issue was that only python 2.6 interpreter was loading when using auto-config and I wasn’t able to add python 3.1. After countless hours trying and searching for a solution thanks to this post I am reading to start learning python.

    Thanks You A Lot.

    I have bookmarked this site and plan to keep coming back.

  4. yarish says:

    you are awesome , really liked it . 10/10 Star.

  5. Stefan T says:

    There is a peculiarity for Eclipse Indigo on Linux (Ubuntu) – python cannot be added as an interpreter to Eclipse the way it is apparently for windows and mac.
    The “work with…” does not appear as an option.

    A workaround that I found is to start a new project after installig PyDev in eclipse and over there there is a link sayingsomething like “pick an interpeter for this project” or something to that effect.

    >>>Click on that link, then >>> click add and over there under “name” you specify the name and under “interpreter” you specify the path – for me that is “/usr/bin/python3” – which I got preinstalled with the OS and that will find python and will add it permamently for all projects from now on.

    Another peculariaty for eclipse on Linux in general >>> when adding new software sites for plugins, the plugins themselves do not appear when you add the website, you will have click “Select All” and click “Next” and on the next page you will see what plugins have been selected.

    >>>So if you don’t want something you can go back and use the filter in a such way that you filter out all of the programs that you don’t want and then click “Select All” and then “Next”. I did the same thing for python and when installing the android framework and this was the case in both situations, but I’ve installed them both successfully, apparently that is a bug in eclipse under the Linux distribution

    Hope that helps,

  6. KB says:


Leave a Reply

Your email address will not be published.