KP

Get Started With Python: Installation, Quickstart, and Command Line Basics

By Krishnamohan Yagneswaran
Tech Blog

Get Started With Python

Try Python Without Installing Anything

Python can be explored even without installing it on your computer. Online Python editors let you type Python instructions in your browser and immediately view the result. This is useful for learning basic concepts and testing small examples without any setup.

A simple example often used for beginners is:
"print("Hello, World!")"


Python Installation

If you want to run Python on your own computer, you can install it locally.

Many Windows and macOS systems already include Python.

On Windows, you can check by searching for Python in the Start menu or by opening the Command Prompt and running:
"python --version"

On Linux or macOS, open the terminal and type:
"python --version"

If Python is not installed, it can be downloaded for free from the official Python website at python.org.


Python Quickstart

Python is an interpreted programming language. This means you write Python files with a .py extension and then run them using the Python interpreter.

Create a new file named hello.py in any text editor and add the following line:
"print("Hello, World!")"

Save the file, open your command line, navigate to the folder where the file is saved, and run:
"python hello.py"

If everything is working correctly, the output will be:
"Hello, World!"

You have now written and executed your first Python program.


Python Version Information

To check which Python version is currently being used in an environment, you can access system details using Python’s built-in modules.

An example approach looks like this:
"import sys"
"print(sys.version)"

More information about importing and using modules will be covered later in the tutorial.


Using the Python Command Line

For quick tests, you do not always need to create a file. Python can be started directly from the command line.

On Windows, macOS, or Linux, you can start Python by typing:
"python"

If that command does not work on some systems, you can try:
"py"

Once the Python prompt appears, you can type Python statements directly, such as:
"print("Hello, World!")"

To exit the Python interactive mode when you are finished, simply type:
"exit()"


Share this post:Share on TwitterShare on LinkedIn