Install Python

How to Install Python on Windows and Mac








How to Install Python on Windows and Mac | Devyra Guide

How to Install Python on Windows, Mac, and Linux

Many modern Windows PCs and macOS systems come with Python pre-installed. However, verifying the installation is essential before proceeding with development.

Checking Python Installation

On Windows:

To verify if Python is installed on a Windows computer, you can search for “Python” in the Start Menu or open the Command Prompt and run:

C:\Users\Your Name> python --version

On macOS and Linux:

For macOS or Linux users, open the Terminal (or Command Line) and type:

python --version

If Python is not found, you can freely download and install it from the official Python website:

https://www.python.org/

Python Quickstart Tutorial

Python is an interpreted, high-level programming language. Developers typically write code in .py files using a text editor and then execute them via the Python interpreter.

Creating Your First Python File

Let’s create a simple Python file named hello.py:

print("Hello, World!")

Save the file. Then open your command line, navigate to the folder containing your file, and run:

C:\Users\Your Name> python hello.py

The expected output will be:

Hello, World!

Congratulations! You have just written and executed your very first Python program.

Running Python in the Command Line

For quick testing or debugging, Python can be used directly in the command line interface without creating a file.

Type the following in your terminal (Windows, macOS, or Linux):

python

If that does not work, try:

py

This will launch the interactive Python shell. From here, you can execute Python code line by line. For example:

>>> print("Hello, World!")

And the output will be:

Hello, World!

To exit the Python interactive shell, type:

exit()

Conclusion

Installing Python and running your first script is a simple yet essential step into the world of programming. With this guide by Devyra, you’ve now laid the foundation to build Python applications, automate tasks, and dive deeper into coding with confidence.


More From Author

Python Introduction

Introduction to Python Programming: A Comprehensive Guide for Beginners

Python Syntax

Python Syntax Guide for Beginners

Leave a Reply

Your email address will not be published. Required fields are marked *

Recent Comments

No comments to show.

Archives

Categories

About Me

Sam Doe

Frequent Traveller

Many lives. Many faces. Different crossroads to different places. 🎶 Listen to my new single release “In My Head” Harlem House Shuffle remix