Python Library Tutorials
Examples, tutorials, guides, and references on many of the common Python programming libraries, modules, and APIs.
HTML Parser: How to scrape HTML content
Prerequisites Knowledge of the following is required: Python 3 Basic HTML Urllib2 (not mandatory but recommended) Basic OOP concepts Python data structures – Lists, Tuples Why parse HTML? Python is one of the languages that is extensively used to scrape data from web pages. This is a very easy way to gather information. For instance, […]
Read MoreHow to Pickle: A Pickling and Unpickling Tutorial
Prerequisites Knowledge of the following is required: Python 3 Basic Python data structures like dictionary File operations in Python Introduction Literally, the term pickle means storing something in a saline solution. Only here, instead of vegetables its objects. Not everything in life can be seen as 0s and 1s (gosh! philosophy), but pickling helps us […]
Read MorePython’s Django vs Ruby on Rails
Python vs Ruby Ruby is a dynamic, reflective, object-oriented general-purpose programming language which was designed and developed in the mid-1990s. Compared to Python, which treats code readability above everything else, the philosophy behind Ruby is that programmers should have the flexibility, freedom and power to write concise and compact code. The most important difference between […]
Read MoreIntroduction to SQLite in Python
SQLite3 is a very easy to use database engine. It is self-contained, serverless, zero-configuration and transactional. It is very fast and lightweight, and the entire database is stored in a single disk file. It is used in a lot of applications as internal data storage. The Python Standard Library includes a module called “sqlite3” intended […]
Read MorePython for Android: The Scripting Layer (SL4A)
The Scripting Layer for Android, SL4A, is an open source application that allows programs written in a range of interpreted languages to run on Android. It also provides a high level API that allows these programs to interact with the Android device, making it easy to do stuff like accessing sensor data, sending an SMS, […]
Read MoreRecursive File and Directory Manipulation in Python (Part 1)
If you are looking to utilize Python to manipulate your directory tree or files on your system, there are many tools to help, including Python’s standard os module. The following is a simple/basic recipe to assist with finding certain files on your system by file extension. If you have had the experience of “losing” a […]
Read MorePython Generators and the Yield Keyword
At a glance, the yield statement is used to define generators, replacing the return of a function to provide a result to its caller without destroying local variables. Unlike a function, where on each call it starts with new set of variables, a generator will resume the execution where it was left off. About Python […]
Read MorePySide/PyQt Tutorial: Interactive Widgets and Layout Containers
In the last installment, we looked at some of the functionality provided to all QWidget-descended Qt widgets, and we looked at one specific widget, the QLabel, in more depth. We also worked our way up to an example that illustrated the structure of a simple Python/Qt application. Thus far, however, we’re not able to do […]
Read MoreIntroduction to Tweepy, Twitter for Python
Python is great language for all sorts of things. Very active developer community creates many libraries which extend the language and make it easier to use various services. One of those libraries is tweepy. Tweepy is open-sourced, hosted on GitHub and enables Python to communicate with Twitter platform and use its API. For an introduction […]
Read MoreInstall PySide and PyQt on Windows, Mac and Linux
In the last article, I introduced you to Qt and its Python interfaces, PyQt and PySide; now that you know a bit about them, pick one and install it. I recommend PySide for two reasons: first, this tutorial is conceived in terms of PySide, and may cover a few topics that are less fully-implemented in […]
Read More