Python Page

Python

Python Logo

Python was created by Guido van Rossum and first released in 1991 it has a design philosophy that emphasizes code readability, notably using significant whitespace.

In July 2018, Van Rossum stepped down as the leader in the language community after 30 years.

Python interpreters are available for many operating systems and is open source software.

Setting out with python

Python is a programming language with a clean syntax that is easy to learn and makes a great first computer language to learn.

A good guide to start with is pythonbasics.org and loads of samples are available at Beginners Guide for NonProgrammers.

Do I have Python Installed

To find out open your terminal or command prompt and then type

python --version then press the Enter / Return key

If Python is installed it will return Python and the version installed

Python 3.9.19

If its not installed and you are using windows you will see

Python was not found; run without arguments to install from the Microsoft Store, or disable this shortcut from Settings > Manage App Execution Aliases.

Built-in web server

Python has a command-line interface (CLI) web server option that allows us to use Python's built-in http.server module to start a simple web server. Lets take a look with this quick example of how you can do it:

Open your terminal or command prompt.

Navigate to the directory you want to serve files from (You can use CD mywebsite where mywebsite is the name of folder you want to move to).

Then run the following command:

For Python 3.x:

python -m http.server

For Python 2.x:

python -m SimpleHTTPServer 8000

This will start a web server on port 8000. You can then access the server by opening your web browser and navigating to

http://localhost:8000