Transcript for:
Python Programming Language and Installation Guide

hello and welcome to my YouTube channel in this competitive world if I want to achieve something I need to continuously upgrade my skills and computer programming is one of the versatile skill that can be used in many fields computer is an electronic device that collects information stores it and process it according to the given instructions and finally gives you the result output to perform task computer needs instructions and this set of instructions are called as program and the one who gives this instructions or the one who writes the program is called as programmer and to give this instruction to the computer we need programming language like for us to communicate with others we need language right in the same way programmers also need language to communicate with the computers and this language is called as programming language programming language is a way for programmers to communicate with the computers and C C++ python Java JavaScript these are the some of the famous programming languages available now and we can divide this programming language into three parts that is lowlevel language high level language and middle level language okay okay first let's talk about low-level language lowlevel languages are very close to the computer instruction set and processor can easily understand this language and we can further divide this lowlevel language into two parts one is machine language another one is Assembly Language machine language is the computer's language in simple terms it is the language that computer understands in this language the instruction will written in zeros and one it consists of series of binary numbers that is zeros and ones and as I said this is the computer's language so computer can easily understand this instructions and it will execute the program faster but for the programmers to understand the instruction written in zeros and ones quite difficult and also to find the error in that series of zeros and ones also difficult so we can say machine language is computer friendly and it is not so friendly for the programmers next let's talk about assembly language compared to Machine level language the Assembly Language is more readable and these languages are designed for specific processors it represent the set of instruction in readable and symbolic form we can say assembly level language anguage is just a human readable way to write machine language rather than writing the instruction in zeros and ones like in the machine language here we'll write the lines like this add we can use add M like this and to convert this assembly level language to Machine level language we can use assemblers and these lowlevel languages are machine dependent they are not portable okay so this is about the lowlevel language next let's talk about high level language high level languages are easily readable easy to write as well as easy to maintain finding the error in these instructions are easier because it is more readable these languages are programmer friendly and to translate this high level language to Machine level language we can can use compiler or interpreter python Java JavaScript these are the few high level languages these languages are machine independent so it is portable okay so lowlevel languages are machine friendly high level languages are programmer friendly next is middle level language it is also called as Intermediate Language it lies between lowlevel and high level language it is closely related to machine as well as human being it supports the feature of both low-level as well as high level languages and c and C++ are considered as middle level language okay so this is about the programming language and its types as I said python is a high level language and with this video I'm starting a brand new video series on Python programming language python is a versatile in demand programming language widely used easy to learn and used in various domains like web development data analysis artificial intelligence automations machine learning game development Etc python was initially designed by GAO van rosm released in 1991 and developed by python software for foundation and python was named after a famous TV show that is Monty Python's Flying Circus okay so this is about Python programming language and its origin next let's see why you should learn Python programming language the first reason is it is a widely popular in demand programming language in this competitive World Learning a widely popular in demand and programming language can help you with your job opportunities as well as salary hike and the second reason is it is easy to learn beginner friendly programming language its syntax is clean and expressive closely resembling the English language it syntax is very simple and readable third reason is python code works on every platform be it Linux Windows or Mac OS Python program works on every platform and the fourth reason is python is versatile you can use it for both simple task as well as complex task and the fifth reason is python has a vast and active Community if you have any queries you can post it on the community forum and you can get help from the other developers okay these are the some reasons why I should learn Python programming language language okay next we'll see how to download and install python in Windows there are two possible ways python can be installed on Windows one way is you can download and install python from the Windows Microsoft App Store and another way is you can download the windows installer from the python official website and then you can install it manually but before installing py python first we need to open up the command prompt in the command prompt just type python version and press enter if python is already installed in your system then it will give you the version of the Python installed in your system if it is not installed then here you can see this message python was not found run without arguments to install from Microsoft store or disable this shortcut from the settings that means python is not found in this system it is not installed in this system if you want to download and install it from the Microsoft store then you need to use the command python without any arguments or if you want to do that in another way that is if you want to download it from the official website and you want to install it manually then you need to disable some shortcuts but first here in this part we are using m Microsoft App Store to download and install the python so no need to disable any setting you just need to write the command Python and you need to run it without any arguments so press enter and here you can see the Microsoft store and here python 3.12 this is the latest version available here and if you see here screenshot descriptions ratings here you can see this is python 3.12 . 3 and here you can see python 3.8 3.9 other versions of python the latest version is python 3.12 so we'll download and install this to download and install python you need to click on this get button so click on this it will download and install python in your system all right done with the downloading and installation now let's close this Microsoft store and in the command prompt now if I type python version python 3.2.3 is installed in the system and in the Windows start menu here if I search for python here you can see the python app as well as ideally so this is about how you can download and install python from the Windows Microsoft App Store okay next let's uninstall python first because in the next session I will show you how to download python from its official website we'll download the python executable installer from its official website and install it manually for that first open up the command prompt and type python version and here python is not installed in my system that's why we can see the message python was not found run without arguments to install from the Microsoft store in the previous part we installed python from the Microsoft store here we want to download and install python from the official website for that first we need to disable the shortcut from the settings so first we need to open up manage app execution aliases and we need to disable two shortcuts so for that here type manage app execution aliases click on this and here you can see app installer off installer off disable these two settings okay done close this now we are ready to download the python from its official website for that open any browser and here python.org and here you can see here we want to download the python latest version so go for downloads and it will show download for Windows here the latest version is Python 3.2.3 and if you want to view the full list of downloads here you can click on this and here you can see active python releases and just here see python 3.9 plus cannot not be used on Windows 7 or earlier here you can see different version of python here you can see Python 2.7 also so in Python we have python version 3 as well as python version 2 but it is better to go for python version 3 so we'll go for the latest version of Python 3 that is python 3.2.3 we want to download executable file that's why I'll click on this and it will start downloading the executable file so downloading is completed here you can see open file so I'll click on that I want to open the file to install it so I'll close this here you can see this window to install python 3.2.3 64bit select install now to install python with default settings or choose customize to enable or disable features so here we have two option one is install now it will install the python with default settings or you can customize the installation if you click on that here you can see different options and you can customize the options but for now we are beginners so we'll go for this option we'll install the python with default settings it includes ideally pip and documentation create shortcuts and file Association this is the default settings we are installing python on Windows right and windows contains a path variable this is nothing but list of directories that contains executable files so we need to add path here so click on this option okay and here install now now we'll install this so click on this set up progress setup was success successful so we are done with the downloading and installation process so now we can close this and uh if you want to see now if I open the command prompt and here type python version python 3.2.3 okay this is about how to download and install python on Windows in this Python Programming video series we'll not only talk about how to write python programs but also we'll write the Python program execute the Python program and we'll show you the output in this whole series we'll talk about how to write python programs Concepts we need to learn rules we need to follow Etc but first let's learn how to run python programs to write and run python programs first we need to install python in our system python should be installed in our system all right now let's see how to run python programs on Windows we can run our python programs in two ways one is in the interactive mode another one is script mode in the interactive mode as we enter the command and press enter and in the very next step we'll get the output this mode is very convenient for writing the very short lines of code and in the script mode we'll write the Python program in a file and save that file with the py extension and we'll execute that file using python interpreter so first let's see how to run python programs in interactive mode for that first go to start menu and here search Python and here you can see python 3.12 app click on that and it will open up python command prompt python 3.12 this is the version of python installed in your system and here you can see three greater than symbol this symbol indicates that we are in the interactive mode the commands will be executed in interactive mode here you can write your program I'll use print function and I'll print a message and if I press enter now in the next line you can see the output hello YouTube family or you can print another message and if I press enter here you can see the programs and me or you can take and result is 15 it will add the numbers and will print the result okay so in this way you can run your python code interactively using python command prompt and we can do this using command prompt also for that first exit and open up the command prompt type CMD and here you can see command prompt here you need to write Python and here you can see the version of python as well as three greater than symbol it indicates that we are in the interactive mode now and here you can write your code and here you can see the output in this way you can run your python programs in interactive mode next let's see how to write python programs in a file and how to run or execute that using python interpreter for that to write python programs we need a text editor here I'll use notepad and in the notepad let's write a code the first step is to write the program next step is we need to save this file so you can go to file and save and here you can select any location to save your file here I'll save my file in the desktop here you can see and here you need to give file name I'll give my file name as first do py py extension then here save as type as all files and save now I'll close this and here in the desktop you can see my python file now to execute this file open up the command prompt and in the command prompt to execute the Python program first you need to write command python followed by file name. p p y here if I type that now like my file name is first do py and enter we'll get error that is can't open file in this location so our file is not present in that in this location so first we need to find the location of our file so for that first we need to right click on the file and here go to properties and in this properties here you can see location just copy this okay close this and in the command prompt first we need to change the directory for that use CD command and paste that location first we need to change the directory we need to go to the directory in which our file is present for that we are using change directory command and enter so now just type python first do py and here you can see result is nine this is the output of our program let's write another program first open up the notepad and write the program okay save the file okay so let's save this file in the another location that is in the desktop in inside the my program folder and here I'll give my file name as second. py and here all files and save close this and now here in the desktop if I open my program folder here we can see our file go to command prompt first we need to change the location properties your location copy enter and python followed by file name enter hello welcome to my YouTube channel you can um execute this in another way also that is first you need to write the program and you need to create the file then go to the file location that is my file is present in the desktop and my program folder so go here and here you can see in the location bar you can type CMD here here we are opening the command prompt in this location CMD and enter it will open the command prompt with this location so no need to change the directories to execute the program can just typee Python and file name this is the another way and if our file name contains two words that is if I change my file name that is in this program if I change my file name to my first like this there is a space between my file name and if I give do py and all documents all files and save that in the desktop and here you can see my file my first in the file name there is a space and if I want to execute this first go to the location of the file here the file is present in the desktop here you can see and in the location bar open up the command prompt and here we need to write python command followed by the file name right my file name is my first do py and if I execute this it will give error because when there is a space between the file name you need to include that within the codes like here double codes my space first dopy and close the double codes and now if I execute this it will give the result okay next if you don't want your output in the command prompt that is if you want to redirect if you want to save your output in another file you can also do that for that I'll execute this file first which is present in desktop so here open up the command prompt in this location and here we want to execute file first python first. py we want to redirect our output to another file so use this symbol and here create another file output.txt it is a text file and output will be stored in this file if this file is already present it will rewrite that file if that file is not not present it will create that file okay now execute this here we can't see the output right but here in the desktop here we can see output there is a file called output text file if I open this here we can see result is nine output is stored in this text file in this way we can redirect the output to another file okay this is all about how to run Python program using command prompt next let's see how to run Python program programs using idle for that go to the start menu search idle here you can see idle click on this and here you can see idle at the top you can see the python version and here you can see three greater than symbol that means we are in the interactive mode and commands will be executed in the in the interactive mode here you can type hello and it will give you the result if you want to run your program in the interactive mode here you can use this python shell and if you want to write the Python program in a file then here go to file and new file or you can press crn and here in the new file you can and save the this file so you can press contrl s or you can go to file and save and you can choose the location if I want I can save this in the desktop and file name okay do py extension save as type python file save and here in the desktop you can see our python file to run this Python program go to run and here run module or you can press FY also and here you can see the output you can run python programs in the interactive mode as well as in the script mode using python ideally okay so this is about how to run python programs on Windows okay so the next topic is ideally configuration let's learn about python IDE IDE stands for integrated development and learning environment python ideally is an ID that comes bundled with the python standard distribution this IDE lets you write debug and run your code with ease it serves as a convenient tool for writing testing and debugging python code it is extremely userfriendly especially for beginners due to features like intelligent indentation and highlighting for example this is a Python program written in Python ideally here you can see this program looks so colorful here you can see different colors are used for different purpose for example keywords are written in Orange colors and built-in functions are written in purple color strings are in green color and here font and font style also looks better and also you can change color or font style according to your preference you can create your own theme you can create a comfortable working environment all right so today we'll discuss about that that is how to configure python ideally for that you need to install python ideally as I said python ideally comes bundled with python standard distribution so no need to install it separately when you install python in your system ideally also comes with it to use Python ideally just go go to the search menu and type idle and press enter and here you can see python shell so in the ideally you can run and write python programs in interactive mode as well as in the script mode python shell in ideally provides an interactive environment to run python code and uh the script mode allows you to write the python code and save it to the file and then you can run that file from the python shell so in the previous tutorial we discussed about this today we want to configure python ideally so for that you need to go to the option menu and click on this configure ideally option you can do this in the Shell window or in the file window so here go to option configure ideally click on that here we can see settings window the first tab is fonts and here you can change the font style font size as as well as if you want bold fonts then here you can choose that or you can get the regular font here the current font style is corer new and if you want you can change it to any new style here and you need to click on apply and okay and here you can see font style is changed this is the font sample here you can see how how our font looks here you can change the size now my font size is 25 you can change it to 78 or 40 whatever size you want and here if you want bold font select this if you don't want uncheck this so you'll get regular font in this way you can change the font and font style okay so the next tab is highlights here you can change the highlighting theme either you can can use buil-in theme or you can create your own custom theme here to use buil-in theme here you can see built-in theme is selected and if you click here here you can see ideally classic ideally dark ideally new if you want light theme then you can choose ideally classic apply and okay and our ideally is now ready to use or if you want Dark theme here you can choose ideally dark apply and okay or if you want to create your own highlighting theme then you can do that for that first here you can go here click on this tab you can change the color of normal code text or keywords python definition builtins here for example if I want to change the color of normal code or text click on this and go to choose color for and here you can choose any color for example I'll choose this color okay here you need to enter a name for your new custom theme I'll just take name as amul here you can see yellow color now for normal code or text you can change the background color of normal code or text for that click on this background button and choose color for you can choose any color okay in the same way you can change the color of python keywords foreground choose color for choose any color for example black and if you want to change the background color go here choose color for okay in this way you can create your own theme here you can choose the area in which you want to change the color and you can change the color of that using this option choose color for and and after creating your own theme Here we can see a custom theme is selected and our custom theme name is amul then apply okay now here you can see your ideally this is the editor window if you want to see the python shell here you can see in this way you can create your own custom theme if you want built-in theme go here and here you can choose any Dark theme or light theme and select that click on apply and okay and here if you want to delete your custom theme just click on this and here delete custom theme yes okay so this is about highlights tab here you can create your own custom theme or you can use buil-in themes okay so the next tab is Keys here you can see short cut keys for different actions here we are using buil-in key set here we have different option in buil-in key set ideal classic Mac ideal classic Unix ideal classic Windows here you can see here ideal classic Windows is selected now and if you come here custom key bindings here you can see different action and uh keys for that action just for an example if you want to copy the text you can use control C to cut the text you can use CR X so if you want to see which keys are used for a particular action you can check out this Keys Tab and also you can create your own key set you can create a custom key set you can create a new key for a action for that first click on that action like this and here get new keys for selection and here you can choose Control Alt or shift I'll choose control and here I'll choose one okay and click on okay here enter a name for your new custom key set okay now here we can see we are using a custom key set the theme name is a in that to go to the beginning offline we are using control key 1 I'll show you how it works I'll just give apply and okay and our CER is here now if I want to go to the beginning of line I need to press control 1 and here you can see curer is here okay so in this way you can create your own custom key set for that first choose the action just like if I want to change the key of this check module click on this then go to get new keys for selection and select new keys create new theme just apply and okay and you are done and here also if you want to use buil-in key set select this and if you want to delete this custom key set then just click on this delete custom key set s all right so this is about Keys Next is Windows in this tab window preferences first is at startup open edit window or open shell window that is when you open ideally whether you want to open the shell window or edit window if you want to open shell window you need to choose this option if you want to open edit window window you need to click on this option for example I want to open shell window when I open the ideally so for that I'll choose open shell window apply and okay that is the default settings and if I open ideally now and here we can see the shell window here if you want edit window then you can choose this option apply and okay close this open ideally and here you can see the edit window when I open my ideally it will open the edit window all right the next is you can change the size of window width is 80 now height is 40 you can change this and indent space four by default it is four you can change this also and here you can see cursor blink if you want curs blink you can choose this option if you don't want just click on this apply and okay Cur won't blink here you can see this right if you want cursor blink click on this option you can do experiment with this okay so this is about Windows you can change the size or which window to open when you start the ideally indent space curs blink we have many option here the next is shell or editor preference first is shell preferences Auto squeeze minimum lines default value is 50 Auto squeeze will reduce large amounts of text to single button which can be clicked to view the text and this is helpful when you have script which is producing with multiple lines of output so that is here now we can see our Autos squeeze minimum lines is uh 50 okay so in the Shell I'll just type help and St Str it will give all the information about St Str string then I'll press enter and here we can see squeezed text as the output if I want to see the output now that means if I want to expand it you need to double click on that or right click for more information just like view here you can see the output or you can double click on this to expand this output it has 446 lines and the default value for uh Auto squeeze is 50 that's why it will squeeze the text if you don't want this button as the output then here you can increase this lines for example 500 it has 446 line right that's why apply and okay it won't squeeze the text all right okay so next let's talk about editor preference at start of run that is when you press FY prompt to say or no prompt that is now here we can see prompt to save is selected and now if I do any changes to my program just for example I'll just use print function okay if you go to run option and run your program or if you press FY you can see this window source must be saved okay to save this window right if you don't want to see this window here you can select no prompt app and okay now if I do any changes here and I won't save the file I'll go run run module I'll go to run and run module you didn't see any prompt here we didn't see any prompt asking us to save our file this option is all about that if you want the prompt to save or now prompt and next is show line numbers in the new windows if you want line numbers in your program then you can select this option app and okay when you open new window or new file here you can see the line numbers line numbers are helpful to find the errors in your program all right so this is about how to add line numbers in your program the next is Max context lines and the default value is 15 this is actually about the size of code context window the code context show you the scope of Loops class Etc you can increase the size of the code context window or decrease the size of code context window using this option all right then is last tab that is extensions extensions are wonderful additions improvements to the editor or interpreter Windows it adds extra functionalities to the ideally okay so this is about how to customize python IDE and uh that's it for now guys thank you for watching don't forget to subscribe to my channel I will meet you next class till then take care