Python Installation

Installing Python

  • Open your browser and head over to www.python.org
  • Click on the “Download” button
  • Choose the latest version
  • Open the downloaded .exe file (double clicking it, “downloads” folder usually)
  • Choose “Run”
  • Choose “Customize Installation”
  • Check all the “Optional Features” hit “Next”
  • In “Advanced Options” change installation directory (leave boxes checked as they are)
    • Navigate to C: drive and create new folder call “Python”
    • Choose C:\Python as your installation directory
  • Click install – sit tight – click “OK” when done

Test Installation Correct

  • Go to the Start Menu search box, type in “IDLE”
    • It stands for Integrated Development Environment (What about the “L”?  I don’t know sorry.)
  • Click on the “IDLE (Python version)”
  • A Python shell should open up for entering Python code directly
  • Type the following into the shell
    • print(‘Hello World!)
  • Hello World should appear on the next line
  • Done!

 

Install PyCharms

You can code Python in any text editor, you save the code as a .py extension.  But there are 2 editors that can make life easier for coding Python.  One is Eclipse, which is a professional editor used for many different programming types.  It is very useful but a tad hard to install and get running.  Plus there are a million settings on Eclipse that lead to confusion.  It is a fabulous tool, I recommend you get it and start learning it.  For our purposes the simplicity of PyCharms is going to work much better.

  • https://www.jetbrains.com/pycharm/
  • Want the lightweight community edition, it is free
  • Choose download
  • Open and run with default choices
  • Double click your JetBeans PyCharm icon and you are ready to go!

 

Notes

You can run Python commands directly in IDLE or you can save files with a .py extension and then run the program.

Helpful Terminology

  • Expression = a line of code like x = y +1
  • Block = several lines of code spaced from the left the same
  • Function = program within a program
  • Parameters = data you feed a function when you call it to work
  • Calling a function = running a function

 

<– PREVIOUS  or  NEXT –>