Monday, November 21, 2011

How to Install Python on Windows

Here are simple steps to install and write your first program in python on Windows. It will hardly take 10 mins.

Download Active Pythong

  • Unless you know you have a newer 64-bit machine, play it safe and click on the “x86″ 32-bit version. You’ll also notice newer distributions of Python listed farther down the page. For now, use the version recommended by ActiveState in the blue bars. You can come back later and install a newer distribution once you become a Python convert, but most tutorials for new users are still written for older Python versions, so be conservative for now.
  • When you click on the blue bar, Python should begin downloading.
  • Make a note of where you download this file on your computer.
  • Double-click on the ActivePython file.
  • Up pops the ActiveState box and tells you it’s going to install ActivePython. Click Next.
  • Up pops the Licensing Agreement. Check the Accept box. Click Next.
  • Up pops a dialogue box allowing you to customize the installation. Don’t customize it. Click Next.
  • See the button that says “Install”? Click it.
  • You’re done, and the ActivePython User Guide appears.
  • Now go to START | All Programs | ActiveState ActivePython (version number) (32-bit)
  • The menu will break out into submenus. You want the one that says: “IDLE (Python GUI)” Click on it.
  • Your cursor will be blinking just to the right of a prompt that looks like this: >>>
  • Type the following command there and make sure that “Hello World!” is inside quotation marks:
    >>> print “Hello World!”
  • Press Enter. You should see Hello World! appear in a different-colored font on the line below.
  • If so, you’re done!
  • If you get an error message that says: “SyntaxError: invalid syntax” then you either forgot the quotation marks or you installed Python version 3.0 or greater, which uses a different print command.

Python Print Hello World

No comments:

Post a Comment