Tuesday, May 5, 2020

GUI development - Python 3

Hey there, this is going to be a complete GUI development series using Python 3. 

GUI means Graphical User Interface. We can develop different computer softwares like calculators, Notepad, Notepad++, Excel, Python IDE, Adobe Photoshop etc.


                                   GUI development

From simple softwares to advanced softwares, we can build any kind of software. We will be using Python 3 on Pycharm

For this install Spyder and Python3 IDLE .In this complete tutorial series , we will be using Tkinter - a python module to develop GUIs.


                                            Tkinter 


1. Create a simple window 


********************************************************
#import tkinter module 
import tkinter as tk

#create an instance/object of Tk
window=tk. Tk()

#set geometry and title
window.geometry('600x600')
window.title('1st Window')

window.mainloop()
********************************************************

What I did?
First I imported  the tkinter module. Then I set the window geometry size and window title with the help of created instance. The entire code should be above  window.mainloop.

Output







Labels:

Add Python and Pip to Path

Hi, there. Welcome to the Python Section of Guiding Point. While Python is tremendously used in sections like Web development, Application development, Machine Learning, Data Science, Artificial Intelligence, it is also used for Scripting.

Starting right from the basics, you have to dive deep into the world of Python modules. Some of the widely used modules in the field of ML(Machine Learning) and AI(Artificial Intelligence) are Numpy, Scipy, Matplotlib, Tensorflow, Pytorch.

Here I am using Python3. We will be discussing all these modules later on. Some hands on projects will be done on this blog. So stay tuned for the same.

So in this post, we will be discussing what is pip and how we can  add pip to the path. First you have to add both the Python3 and pip to the path and then you have to install pip on command prompt

What is pip?
Python comes with a handy of modules and to use them we use an installer tool called pip. These modules are really helpful to do some quick and cool stuffs. So you should learn how to use pip.


How to add pip to path?

We can take advantage of pip only if it is added to the path variables. There is a step by step method to add pip to the path

  • Copy the paths of Python and pip from the download location of python. Go to the scripts section and copy the script location as shown.

  • Asuming that you know how to copy the address from the top.



My path looks like this :
C:\Users\Vikas singh\AppData\Local\Programs\Python\Python37

 C:\Users\Vikas singh\AppData\Local\Programs\Python\Python37\Scripts

  • Go to the properties of This PC. Do this by following the sequence shown below:
Right click on This PC> Properties> Advanced system settings

Then a pop up will appear as shown below:
  


  • Check on Environment Variables.
  •  There is an option for path in user variables and system variables.
Follow:
Environment Variables> Path> New

Then finally add 1st path in user variables 

and 2nd path in system variables.


How to install pip on Command Prompt?

>>pip install pip

Go to command prompt and type the above command and hit enter.This above command installs the pip tool using the Command Prompt. So you should know atleast some basic commands of Command Prompt. We get the following result:




How to check if your pip is already installed?
The result of the above command will be : Requirement already satified. This shows that you have successfully added python and pip to the correct path. Finally you can install any library using pip. 

How to install any library using pip once it is added to the path?

>>pip install library name

Like you want to use numpy, scipy library , so you have to type:
>>pip install  numpy
>>pip install scipy


Hope you got what is pip, how to add pip and python the path, how to check if pip is successfully added to path, how to install any library using pip.

Please do share the post to your class groups, friend groups  and to everyone who is learning Python. 

For more updates follow: Guiding Point












Labels: