Installing python and making your first script

Python is a great programming language, easy to learn and extremely versatile. In this article i’d like explain how to install python as a foundation for future posts.

First we need to download the python installer from the official website.

Find the download button, any version higher than 3.7 should work for my tutorials

Once you’ve downloaded the installer you need to do some configuration:

Add python to your PATH

Make sure to select the Add Python 3.9 to PATH option as this will make running your scripts a lot easier. Feel free to either select or deselect Install launcher for all users.

Hit Install Now and let the installer work its magic.

Disable the path lenght limit

You might want to disable path lenght limit as this might help you later on.

With that out of the way we can start and make our first runnable python script. Make a new file and call it test.py. The .py extension lets our computer know its a python file. Make sure the file isn’t called test.py.txt as that will be a very difficult problem to troubleshoot (speaking from experience).

A little non-descriptive but will do the trick

Open the file and write the following script:

1x Hello World is too boring

This script will print out “Hello World” 10 times (cliché, i know).

Open up your CMD and navigate to the folder where you saved your brand new Script.

Feeling like a hacker already?

first type python, this will tell the computer you’re going to run a python script. type the name of your program, test in this case and finish it with a .py as thats the full official name of the program. Ill tell you next time how to omit the python and the .py but we’ll stick to the basics for now. If you’re intrested you can read how to do it here

Hit Enter and BAM! you’re a python programmer!

now go add Python programmer to your resumé

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store