• Articles

PYTHON TOOLKIT

PYTHON TOOLKIT

What is Python?

Python is a high­ level programming language. It can be easily used with other languages such as C, C++, broadening the range of its application to nearly all fields of programming. Programming in Python is fun because selected lines of code are needed compared to other programming languages to get the desired output.

Check this insightful Intellipaat Python video:

 

Python interpreters are available for the installation on different operating systems, allowing the code execution on a wide variety of systems. There are three tools in its toolkit:

  • wxPython
  • PyQt
  • PyGTK

Python is one of the most demanding skills right now in the market. Enroll in our best Python training in Bangalore and become a Python Expert.

wxPython

wxPython is a blend of wxWidgets and programming library. It is a popular cross-platform GUI toolkit. wxWidgets is a wrapper written in C++. It has lots of widgets. They are divided into logical groups.

  • Base Widgets
  • Top level Widgets
  • Containers
  • Dynamic Widgets
  • Static Widgets
  • Other Widgets

Get 100% Hike!

Master Most in Demand Skills Now!

Want to learn in detail? Read this extensive Python tutorial!

Principal modules in wxPython API include a core module. It consists of wxObject class, which is the base for all classes in the API. Control module contains all the widgets used in GUI application development.

Example: wx.Button, wx.StaticText (analogous to a label), wx.TextCtrl (editable text control), etc.

 

Windows

Prebuilt binaries for Windows OS (32 bit and 64 bit) are available on Download wxPython page. Latest versions of installers are available on wxPython3.0-win32-3.0.2.0-py27.exe (32-bit Python 2.7) wxPython3.0-win64-3.0.2.0-py27.exe (64-bit Python 2.7)

A simple GUI application displaying Hello World message is built using the following steps −

  • Import wx module.
  • Define an object of Application class.
  • Create a top level window as object of wx.Frame class. Caption and size parameters are given in constructor.
  • Although other controls can be added in Frame object, their layout cannot be managed. Hence, put a Panel object into the Frame.
  • Add a Static Text object to display ‘Hello World’ at a desired position inside the window.
  • Activate the frame window by show() method.
  • Enter the main event loop of Application object.
 
 

Code:

import wx
app = wx.App()
window = wx.Frame(None, title = "wxPython Frame", size = (300,200))
panel = wx.Panel(window)
label = wx.StaticText(panel, label = "Hello World", pos = (100,50))
window.Show(True)
app.MainLoop()

Output:

Hello World

Interested in learning How to Make Calculator in Python ? Go through this Step-by-Step Guide

 

PyQt

PyQt is a set of Python v2 and v3 bindings for The Qt Company’s Qt application framework and runs on all platforms supported by Qt including Windows, MacOS/X and Linux. PyQt is one of the two most popular Python bindings for the Qt cross-platform GUI/XML/SQL C++ framework.

PyQt is available in two editions:

  • PyQt4 which will build against Qt 4.x and 5.x
  • PyQt5 which will only build against 5.x.

PyQt contains over 620 classes that cover graphical user interfaces, XML handling, network communication, SQL databases, Web browsing and other technologies available in Qt. The latest iteration of PyQt is v5.4.

Enroll now in SQL course to learn more about its concepts.

 

PyGTK

PyGTK helps in creating programs with a graphical user interface using the Python programming language. It is a set of wrappers for the GTK+ graphical user interface library.

It provides an object-oriented interface that is slightly higher level than the C programming language. It is easy to install on UNIX. Win32 installer versions are available, and Mac OS X versions are in development.

KiWi is a set of classes and wrappers for PyGTK that were developed to provide a sort of framework for applications.

Get a complete hands-on experience on programming skills by enrolling into Python online Training Course and earn your certification in Python. Intellipat is also providing free guides to prepare for interviews with it’s Python Interview Questions.

Course Schedule

Name Date Details
Python Course 14 Dec 2024(Sat-Sun) Weekend Batch View Details
21 Dec 2024(Sat-Sun) Weekend Batch
28 Dec 2024(Sat-Sun) Weekend Batch