What Is Python?
What Is Python?
What Is Python?
Executive
Summary
Python is an interpreted, object-oriented, high-level
programming language with dynamic semantics. Its high-
level built in data structures, combined with dynamic typing
and dynamic binding, make it very attractive for Rapid
Application Development, as well as for use as a scripting or
glue language to connect existing components together.
Python's simple, easy to learn syntax emphasizes readability
and therefore reduces the cost of program maintenance.
Python supports modules and packages, which encourages
program modularity and code reuse. The Python interpreter
and the extensive standard library are available in source
or binary form without charge for all major platforms, and
can be freely distributed.
Libraries in Python
Normally, a library is a collection of books or is a room or
place where many books are stored to be used later.
Similarly, in the programming world, a library is a
collection of precompiled codes that can be used later on in
a program for some specific well-defined operations. Other
than pre-compiled codes, a library may contain
documentation, configuration data, message templates,
classes, and values, etc.
A Python library is a collection of related modules. It
contains bundles of code that can be used repeatedly in
different programs. It makes Python Programming simpler
and convenient for the programmer. As we don’t need to
write the same code again and again for different
programs. Python libraries play a very vital role in fields of
Machine Learning, Data Science, Data Visualization, etc.
Normally, a library is a collection of books or is a room or
place where many books are stored to be used later.
Similarly, in the programming world, a library is a
collection of precompiled codes that can be used later on in
a program for some specific well-defined operations. Other
than pre-compiled codes, a library may contain
documentation, configuration data, message templates,
classes, and values, etc.
A Python library is a collection of related modules. It
contains bundles of code that can be used repeatedly in
different programs. It makes Python Programming simpler
and convenient for the programmer. As we don’t need to
write the same code again and again for different
programs. Python libraries play a very vital role in fields of
Machine Learning, Data Science, Data Visualization, etc.
Python offers multiple options for developing GUI
(Graphical User Interface). Out of all the GUI methods,
tkinter is the most commonly used method. It is a standard
Python interface to the Tk GUI toolkit shipped with Python.
Python with tkinter is the fastest and easiest way to create
the GUI applications. Creating a GUI using tkinter is an
easy task.
To create a tkinter app:
1. Importing the module – tkinter
2. Create the main window (container)
3. Add any number of widgets to the main window
4. Apply the event Trigger on the widgets.
Importing tkinter is same as importing any other module in
the Python code. Note that the name of the module in
Python 2.x is ‘Tkinter’ and in Python 3.x it is ‘tkinter’.
import tkinter
There are two main methods used which the user needs to
remember while creating the Python application with GUI.
1. Tk(screenName=None, baseName=None,
className=’Tk’, useTk=1): To create a main window,
tkinter offers a method ‘Tk(screenName=None,
baseName=None, className=’Tk’, useTk=1)’. To
change the name of the window, you can change the
className to the desired one. The basic code used to
create the main window of the application is:
m=tkinter.Tk() where m is the name of the main window
object
2. mainloop(): There is a method known by the name
mainloop() is used when your application is ready to
run. mainloop() is an infinite loop used to run the
application, wait for an event to occur and process the
event as long as the window is not closed.
m.mainloop()
import tkinter
m = tkinter.Tk()
'''
'''
m.mainloop()