X



Home>Tutorial>

Python Tutorial Day 1: Introduction And Setting Up Your Editor For Development

Isaiah Ozadhe Friday, August 7, 2020 Python

Hey!!!!, welcome to Emmason247. Today we are goint to be looking at an Introduction to the Programing language, set up our Text Editor for python development, learn how to debug pyton code on Vs-code and do a simple 'Hello World Program' (Thats always the first thing right?).
cover

Introduction

Before we start, here are a few important things you should know about the Python programming language:
  • It is an interpreted programing language.
    Click To Read My Article About The Difference Between Interpreted And Compiled Programming Languages.
  • It was released in 1991 and was created by Guido van Rossum at the Centrum WisKunde & Informatica ( CWI ) in the Holland.
  • It can be used to create server side code for web development using frameworks like Django, Flask and Bottle.
  • It is currently the hottest language for data science.
  • It can be used for software development using tkinter, kivy and the rest of their kinds.
  • Thoughh it is not a native language for mobile development, it can still be used to develop mobile apps.
  • It is Platform independent (i.e it works on windows, linux etc.)
  • It's syntax is very close to the english language.
  • It supports object oriented programming.
The things i enumerated above are by no means everything you need to know about python but this would do for now. Stay tuned because every now and then am going to be writing a few articles that will tell you more on the python programming language.

Python Installation

To install python on windows, Click to download the installation file of python's latest version. After downloading run the executable file and install it as a normal program. If you do not have admin access to your computer, go to the windows Microsoft store and install it but note that the first method is more advisable due to package compatibility issues. When you are done with the installation, open the command prompt and enter the command below.
python --version
if everything went well, you'll see a message displaying the python version installed:
version

Editor Configuration

For the sake of this tutorial, we will be making use of a free editor known as visual studio code. to install and set it up follow the steps below:

Installing visual studio code.

To download the installation file for VS code, click on this link. Install it after the download and move to the next step.

Installing VS code python extension.

Now launch the newly installed visual studio code and click on the Marketplace or Extensions at the left Corner of the screen.
extension
type python in the search bar and select the official Python Extension from Microsoft to install:
intalll
If you are done with the installation, move to the next step.

Setting up Vs code to use python.

Navigate to your desktop or anywhere you'll like to keep your tutorial files ( it is important to keep it safe because we will be using the same folder till the end of this tutorial ) and create a folder called tutorial. Inside VS code click on File>Open Folder and select the folder you just created. Now click on View>Command Palette or press Ctrl+Shift+P, Use the search bar to search for the command 'Python: Select an Interpreter', click on it and select your interpreter.
select inter

inter
All Right!!!!!!!!!!!!!!!. That is we are ready for development.

Testing

I don't know who started it or where it came from but i just know that we have to do 'Hello World'. That is how we are going to Test. Right click the 'New file' icon create a new file with the name 'helloworld.py'
new file
Enter the code:
message = "Hello World!!!!!!. You are now on your way to being a programmer"
print(message)
To run the code, Right Click anywhere on the work space and click on 'Run Python File in Terminal'.
run
if you look at the terminal window and see our text in the quote printed, then Congratulation!!!! it worked.
outpu

Debugging

Once in a while, you are going to write code that does not work and you think you have not done anything wrong. In situations like this, you are going to have to debug. If you get this part right, then your journey in python programming will be a bit easier. Add a break point by clicking on a position behind the line number 2:
lines
Now press F5 to start the debugger. Then click Python or Python File. Now you can examine all your variables to know if there is anything wrong. All right guys that is it. We have succeeded in setting up everything and we are ready for Development. On Day 2, we'll start with 'Working with Variables.' If have any issue, just add a comment and I'll let you know. I remain Isaiah Ozadhe and i write about programming every now and then in very SIMPLE TERMS. Read some of my other articles and Stay Tuned.

| | Views(931)

See Demo | Download File


Add your comment. Indicate code using code tag


Words: 0 | Chars: 0 | Reading Duration: 0



Images Attachment




Emmason Integratded Services(2017-2024)
All Rights Reserved
Designed and Maintained By Emmason Integrated Services