Introduction: Installing Python (Easy!) and How to Use It
Need to install Python to do some programming, or get an application to work on your computer? Well you are in the right place! This tutorial will show you how to install Python quickly and easily onto your machine!
Supplies
You will need the following:
- Internet.
- Computer (Windows, Mac, etc.)
- Capability of downloading and installing files on your machine.
Step 1: Download Python
You can download the Python installer from https://www.python.org/downloads/ and choose the installer that fits your OS (Mac, Windows, Linux, etc.) I am installing this on a Windows 10 machine.
You should see the downloaded installer file in your downloads folder on your computer.
Step 2: Run the Installer
Once the installer file has finished downloading onto your computer, you may double click on it and run the installer file.
- You will see the window show up, and you can click the top option on the installer (Install Now)
- If you get a dialogue like shown in image 2 above, press "Yes" and the installation will continue
- The progress bar should move as it installs the files and required libraries onto your computer.
- If there were no errors, you will see the end installation page, as shown in the last image.
- Press Close at the bottom of the installer, and you should have python installed on your system!
Step 3: Opening Python
Now, we want to make sure that python installed successfully. To do so, we can try the following:
- Type python into the search bar of your computer. You should see many different python options (shown in the first image above) If you do not see any python options, restart your computer and try again.
- You should see 3 options if you are using Windows. You will see Python 3.11, the terminal window (first in the image above) and you will see IDLE python. IDLE python has a user interface, and is the programming window for python. Python 3.11 is just the execution window for your code.
- Click on Python 3.11. Don't click on IDLE yet. You will see a black window with some text.
Step 4: Testing Python
In that black Python window that opened, type in
print("hello world")
and press enter. You should see the following result in the top image. If not, make sure you typed EXACTLY what it says above, and try again. If it throws an error, copy it, and paste it in the comment section below. I will do my best to help you resolve the issue.
If the terminal window spits back
hello world
then that means you have successfully installed python onto your machine! Congratulations!
Step 5: Another Test
Here is another test you can try:
In the black python window, type:
import sys
and press enter. Nothing should visibly happen.
Now, type:
sys.version
and press enter.
You should see a result similar to the one in the image above.
Step 6: Programming Something
Now that you can confirm that you installed Python on your machine correctly, you can do some programming!
In order to program anything, you will need to open the IDLE version of python. To do so, follow the following steps:
- In your search bar, type Python IDLE and click on the result that has IDLE in it.
- You should see a window as shown in image 2 above. This window is the same as the black window we saw earlier. You can do all the same things in this terminal as the other one.
- Press ctrl + n at the same time to open a blank python file. This will make a new untitled file for you to program with!
- Start coding! You can find some simple codes here to copy and paste into the editor. (https://github.com/Sky-Wired/Simple-Python-Scripts)
- To run the code, just press F5 on your keyboard, and the code will execute!
Step 7: Example Code Scripts
Here are some simple scripts to get you started in Python programming:
https://github.com/Sky-Wired/Simple-Python-Scripts
You can look up more examples on the internet.
Step 8: Done!
Good job! You installed Python on your machine!