Best Python Libraries for Web Applications and GUI
-
Python is a programming language which is absolutely perfect for most of the programming scenarios.
Python provides a ton of third-party libraries that supports our programming needs and most of them are free to use as well.
In this topic we are going to cover some of the most popular, simple to understand and free to use python libraries, that can be used to develop web applications and graphical user interface (GUI) applications compatible with operating systems like Windows, Linux, Mac, iOS, Android, etc.
Python web applications are compatible for web hosting in Linux servers also.For web application development, we have flask and django.
To integrate to different databases like SQL Server, Oracle, MySQL and PostgreSQL to our web or GUI applications, we have packages like pyodbc, cx_Oracle, pymysql and psycopg2.
For word or excel integration, we can use packages like python-docx or openpyxl.
Please see the details below with tutorials and code samples links.
-
Tkinter
Tkinter is the standard python interface for Tk GUI toolkit and is shipped with Python in most of the OS. Tkinter can be used to create desktop applications that can run on Windows, Mac, Linux, etc.
Tkinter Tutorial
Tkinter has several built-in widgets(controls and layouts) that can be used to develop input/output based desktop applications or interactive games that require animations. -
Kivy
Kivy is a simple to understand and use cross platform python library for developing GUI applications.
Kivy Tutorial
Kivy can be used to create desktop applications that can run on Windows, Mac, Linux, iOS based devices, Android devices or any other touch enabled devices. -
KV Language
KV Language is a markup language used by Kivy framework to define the styles and design components of GUI windows and its controls. KV language provides us the option to keep all the designs in a separate file with .kv extension. This is in a way similar to .css files. But the difference is that while css files provides only styling, .kv files can contain entire design components.
KV Language Tutorial -
Flask
Flask is a web application framework written in Python. Flask can be used to develop light weight web applications, that we can develop entirely in Python. Compared to other web application frameworks, flask is simpler and easier to understand and is best for beginners.
Flask TutorialBelow are Flask CRUD samples using different databases.
-
Django
Django is a high-level web application framework written in Python. Compared to Flask, Django has much more features and can be used to develop complex web applications. Initial setup of the Django project requires a bit more work than simpler frameworks like Flask.
Django Tutorial
Django web applications are fast, secure and easily scalable.Below are Django CRUD samples.
-
pywin32
pywin32 is an open source python library that can be used to access Windows COM. Access to COM means that we can control and modify windows programs using python.
pywin32 Tutorial
This helps us to implement almost any thing a windows program can do, like working with excel data, sending outlook email, track session lock/unlock events, mouse pointer data, screen information, etc. -
python-docx
python-docx is an open source python library for working with word documents.
python-docx Tutorial -
-
pyodbc
pyodbc is used to connect to SQL Server or any other ODBC databases like MySQL, Oracle, PostgreSQL, SQLite etc.
pyodbc Tutorial -
cx_Oracle
cx_Oracle is used to connect to Oracle database. Latest version of cx_Oracle supports python3.6 and higher.
cx_Oracle Tutorial
Supports connecting to Oracle database 9.2, 10, 11, 12, 18, 19 and 21. -
-
psycopg2
psycopg2 is primarily used for PostgreSQL databases. psycopg2 is the complete rewrite of psycopg with much more features.
psycopg2 Tutorial