Getting Started with Python (2024)

Getting Started with Python Programming for Windows Users

Installation of Python

  • Download the current production version of Python (2.7.1) from the Python Download site.
  • Double click on the icon of the file that you just downloaded.
  • Accept the default options given to you until you get to the Finish button. Your installation is complete.

Setting up the Environment

  • Starting at My Computer go to the following directory C:\Python27. In that folder you should see all the Python files.
  • Copy that address starting with C: and ending with 27and close that window.
  • Click on Start. Right Click on My Computer.
  • Click on Properties. Click on Advanced System Settings orAdvanced.
  • Click on Environment Variables.
  • Under System Variables search for the variable Path.
  • Select Path by clicking on it. Click on Edit.
  • Scroll all the way to the right of the field called Variablevalue using the right arrow.
  • Add a semi-colon (;) to the end and paste the path (to the Python folder) that you previously copied. Click OK.

Writing Your First Python Program

  • Create a folder called PythonPrograms on your C:\ drive. You will be storing all your Python programs in this folder.
  • Go to Start and either type Run in the Start Searchbox at the bootom or click on Run.
  • Type in notepad in the field called Open.
  • In Notepad type in the following program exactly as written:
# File: Hello.pyprint "Hello World!"
  • Go to File and click on Save as.
  • In the field Save in browse for the C: drive and thenselect the folder PythonPrograms.
  • For the field File name remove everything that is thereand type in Hello.py.
  • In the field Save as type select All Files
  • Click on Save. You have just created your first Python program.

Running Your First Program

  • Go to Start and click on Run.
  • Type cmd in the Open field and click OK.
  • A dark window will appear. Type cd C:\ and hit the key Enter.
  • If you type dir you will get a listing of all folders inyour C: drive. You should see the folder PythonPrograms that youcreated.
  • Type cd PythonPrograms and hit Enter. It should take you to thePythonPrograms folder.
  • Type dir and you should see the file Hello.py.
  • To run the program, type python Hello.py and hit Enter.
  • You should see the line Hello World!
  • Congratulations, you have run your first Python program.

Getting Started with Python Programming for Mac Users

Python comes bundled with Mac OS X. But the version that you have is quite likely an older version. Download the latestbinary version of Python that runs on both Power PC and Intel systems andinstall it on your system.

Writing Your First Python Program

  • Click on File and then New Finder Window.
  • Click on Documents.
  • Click on File and then New Folder.
  • Call the folder PythonPrograms. You will be storing all class relatedprograms there.
  • Click on Applications and then TextEdit.
  • Click on TextEdit on the menu bar and select Preferences.
  • Select Plain Text.
  • In the empty TextEdit window type in the following program, exactlyas given:
# File: Hello.pyprint "Hello World!"
  • From the File menu in TextEdit click on Save As.
  • In the field Save As: type Hello.py.
  • Select Documents and the file folder PythonPrograms.
  • Click Save.

Running Your First Program

  • Select Applications, then Utilities and Terminal.
  • In your Terminal window type ls and Return. It should give a listing of all the top level folders. You should see the Documents folder.
  • Type cd Documents and hit Return.
  • Type ls and hit Return and you should see the folder PythonPrograms.
  • Type cd PythonPrograms and hit Return.
  • Type ls and hit return and you should see the file Hello.py.
  • To run the program, type python Hello.py and hit Return.
  • You should see the line Hello World!
  • Congratulations, you have run your first Python program.

Starting IDLE on Mac

  • In a Terminal window, type python. This will startthe Python shell. The prompt for that is >>>
  • At the Python shell prompt type import idlelib.idle
  • This will start the IDLE IDE

Using IDLE on either Windows or Mac

  • Start IDLE
  • Go to File menu and click on New Window
  • Type your program in
  • Go to File menu and click on Save. Type in filename.py This will save it as a plain text file, which can be opened in in any editor you choose (like Notepad or TextEdit).
  • To run your program go to Run and click Run Module
Getting Started with Python (2024)
Top Articles
Does Antivirus Detect and Remove All Malware?
How Long Will It Take to Make a Profit on a Home Purchase
Is Sam's Club Plus worth it? What to know about the premium warehouse membership before you sign up
Ofw Pinoy Channel Su
Professor Qwertyson
Truist Park Section 135
50 Meowbahh Fun Facts: Net Worth, Age, Birthday, Face Reveal, YouTube Earnings, Girlfriend, Doxxed, Discord, Fanart, TikTok, Instagram, Etc
Ashlyn Peaks Bio
Mawal Gameroom Download
Riegler & Partner Holding GmbH auf LinkedIn: Wie schätzen Sie die Entwicklung der Wohnraumschaffung und Bauwirtschaft…
Slapstick Sound Effect Crossword
Kostenlose Games: Die besten Free to play Spiele 2024 - Update mit einem legendären Shooter
123 Movies Black Adam
Mndot Road Closures
Dusk
Help with Choosing Parts
Uhcs Patient Wallet
Spartanburg County Detention Facility - Annex I
Nissan Rogue Tire Size
Uky Linkblue Login
18889183540
Today Was A Good Day With Lyrics
Dewalt vs Milwaukee: Comparing Top Power Tool Brands - EXTOL
How to Watch Every NFL Football Game on a Streaming Service
Target Minute Clinic Hours
Harrison 911 Cad Log
The Procurement Acronyms And Abbreviations That You Need To Know Short Forms Used In Procurement
Christmas Days Away
417-990-0201
How to Draw a Bubble Letter M in 5 Easy Steps
Bratislava | Location, Map, History, Culture, & Facts
Teenage Jobs Hiring Immediately
Kelsey Mcewen Photos
Omnistorm Necro Diablo 4
American Bully Xxl Black Panther
Gvod 6014
Thelemagick Library - The New Comment to Liber AL vel Legis
18 terrible things that happened on Friday the 13th
Nba Props Covers
Bartow Qpublic
Noaa Duluth Mn
Postgraduate | Student Recruitment
Lacy Soto Mechanic
1Exquisitetaste
Payrollservers.us Webclock
Frontier Internet Outage Davenport Fl
Streameast Io Soccer
Lightfoot 247
Slug Menace Rs3
Www Ventusky
Wieting Funeral Home '' Obituaries
Latest Posts
Article information

Author: Terence Hammes MD

Last Updated:

Views: 5688

Rating: 4.9 / 5 (69 voted)

Reviews: 84% of readers found this page helpful

Author information

Name: Terence Hammes MD

Birthday: 1992-04-11

Address: Suite 408 9446 Mercy Mews, West Roxie, CT 04904

Phone: +50312511349175

Job: Product Consulting Liaison

Hobby: Jogging, Motor sports, Nordic skating, Jigsaw puzzles, Bird watching, Nordic skating, Sculpting

Introduction: My name is Terence Hammes MD, I am a inexpensive, energetic, jolly, faithful, cheerful, proud, rich person who loves writing and wants to share my knowledge and understanding with you.