In order to get started learning the basics of python you’ll need to install the proper software and set up everything you need to run python programs on your computer. This tutorial will cover the basics of
– Installing the latest version of python
– Downloading a text editor
– Running python programs on your computer with the command line
The first step to get started here is to download the latest version of python.
The link below will direct you to the python download for Windows, if you have Mac or Linux then there are links at the top of this page that can redirect you to the downloads for those systems
Below is another link for Windows that might work better for some. Click on the latest executable installer link to download python
When you install python, the IDLE is also downloaded with it. IDLE stands for Integrated Development Environment. You can type your code directly into IDLE and run programs from there but for the purposes of becoming a programmer it is a much better habit to download a separate text editor and use the Command Line to run them.
DOWNLOADING A TEXT EDITOR
In order to run python code you’ll need to type it in a text editor. There are different kinds of text editors, some of them free and some of them not. We will highlight a few of the more popular ones and provide download links for them.
This editor is a free source code editor that supports many languages including python. It is very easy to use and is highly recommended
This one has a few more bells and whistles but you’ll need to pay in order to get it licensed. There is a free version but it is not comparable to notepad++
This is another highly popular editor that has been around for over 40 years. This is highly recommended for experienced programmers who want more than just a basic text editor. It has virtually everything you could ever want or need. However, there is a serious learning curve that is not for the faint of heart.
There are many others to choose from, we simply highlighted a few of the more popular ones and made sure to include one editor that was very simple and easy to use that would satisfy basic requirements like notepad++ and one that came with more of a complete package for more experienced programmers with a steeper learning curve as a drawback.
THE COMMAND LINE
When using a text editor as opposed to IDLE to run your programs you’ll have to utilize the command line. It’s recommended to do this instead of just using IDLE because it will ensure you learn how to navigate the command line and this is something every programmer needs to learn.
In order to run a program you’ll first need to navigate to the folder directory where the python file is located using the cd command. Once you are in the correct directory you can run the program by typing in the word python followed by the name of the file followed by .py.
For example if you had a python file named helloworld.py then you could run it on the command line by typing in python helloworld.py. This will run the program.
If you want to kill a program and you realize you didn’t write something that would specifically handle that in the code you can type ctrl + c and that should do it, if for some reason it doesn’t then type in ctrl + z
You can find more information on the command line here: