Among other merits, Python is an ideal language for writing server-side scripts, allowing you to integrate interactive behavior with HTML. Persisting dynamic content to an underlying database is fairly straightforward. By installing an appropriate Python DB module, you get the ability to interact with the database of choice from within Python code, moving your application data in and out of the underlying persistent store.
This article by Yuli Vasiliev will walk you through the process of building a simple Python application that interacts with a MySQL database. In a nutshell, the application picks up some live data from a web site and then persists it to an underlying MySQL database.Read Python Data Persistence using MySQL in full
Continuing with the sample discussed in the Python Data Persistence using MySQL article, this Part II: Moving Data Processing to the Data by Yuli Vasiliev explains how you can implement some data processing inside your database, resulting in better application design and better performance in the long run. In this article, you will look at triggers in action. Stored procedures and functions can be used similarly.Read Python Data Persistence using MySQL Part II: Moving Data Processing to the Data in full
Python Data Persistence using MySQL Part III: Building Python Data Structures Upon the Underlying Database Data
This article, the third one in the Python Data Persistence using MySQL series by Yuli Vasiliev, discusses how you can implement Python data structures representing data structures stored in the underlying database and then manipulate those data structures on the Python side.Read Python Data Persistence using MySQL Part III: Building Python Data Structures Upon the Underlying Database Data in full
In this article by Mike Ohlson de Fine, author of Python 2.6 Graphics Cookbook, we will cover:
- Static shifting of a ball
- Timed shifting of a ball
- Animation – timed draw-and-erase cycles
- Two balls moving unimpeded
- A ball that bounces
- Bouncing in a gravitational field
Vector graphics can be shrunk and expanded to any size and in any direction using simple algebra. They can be animated with rotations using basic trigonometry. Raster graphics are limited. They cannot be resized or rotated dynamically while the code is executing. They are more cumbersome. However, we can get tremendous effects when we combine both vector and raster graphics together. The one thing that Python cannot do is to rotate a GIF image by itself. There are ways of mimicking rotation reasonably but there are limitations you will appreciate after trying out some of these recipes. PIL can rotate them, but not dynamically on a Tkinter canvas. We explore some possibilities and workarounds here.
In this article by Mike Ohlson de Fine, author of Python 2.6 Graphics Cookbook, we will cover:
- Simple animation of a GIF beach ball
- The vector walking creature
- Bird with shoes walking in the karroo
- Making a partially transparent image with GIMP
- Diplomat walking at the palace
- Spider in the forest
- Moving band of images
- Continuous band of images
- Endless background – a passing cloudscape
In this article by Ninad Sathaye, author of Python Multimedia Beginner's Guide, explains basic image conversion and manipulation techniques using the Python Imaging Library. With the help of several examples and code snippets, we will perform some basic manipulations on the image, such as pasting an image on to another, resizing, rotating/ flipping, cropping, and so on. We will write tools to capture a screenshot and convert image files between different formats.
Specifically, we shall:
- Learn various image I/O operations for reading and writing images using the Python Imaging Library (PIL)
- With the help of several examples and code snippets, perform some basic manipulations on the image
- develop a small application that captures a region of your screen at regular time intervals using ImageGrab.
Python LDAP Applications: Part 1 - Installing and Configuring the Python-LDAP Library and Binding to an LDAP Directory
This article mini-series by Matt Butcher will look at the Python application programmers interface (API) for the LDAP libraries, and using this API, we will connect to our OpenLDAP server and manipulate the directory information tree. More specifically, we will cover the following in this article series:
- Installing and configuring the Python-LDAP library.
- Binding to an LDAP directory.
- Comparing attributes between the client and server.
- Performing searches on the directory.
- Modifying the directory information tree with add, delete, and modify operations.
- Modifying directory passwords.
- Working with LDAP schemas.
This first part will deal with installation and configuration of the Python-LDAP library. We will then see how the binding operation is performed.Read Python LDAP Applications: Part 1 - Installing and Configuring the Python-LDAP Library and Binding to an LDAP Directory in full
This is the second article in the article mini-series on Python LDAP applications by Matt Butcher. For first part please visit this link.
In this article we will see some of the LDAP operations such as compare operation, search operation. We will also see how to change an LDAP password.Read Python LDAP Applications: Part 2 - LDAP Opearations in full
This is the third article in the article mini-series on Python LDAP applications by Matt Butcher. The first part deals with the installation and configuration of Python-LDAP library, and the binding-unbinding operations, and changing of the LDAP password. The second article takes a look at some of LDAP operations.
In this article we will see some more LDAP operations such as add operation, delete operation etc. Then we will take a look at LDAP URL Library.Read Python LDAP Applications: Part 3 - More LDAP Operations and the LDAP URL Library in full
Welcome to the fourth and the last article in the Python LDAP applications series by Matt Butcher. In previous three articles we have seen the installation and configuration of Python-LDAP library, and the binding-unbinding operations, and changing of the LDAP password as well as LDAP operations, and LDAP URL library and some more LDAP operations.
In this article, we will take a brief look at what might be the most complex module in the Python-LDAP API, the ldap.schema module.Read Python LDAP Applications: Part 4 - LDAP Schema in full
This article by Erik Westra the author of Python Geospatial Development - Second Edition, examines a number of libraries and other tools which can be used for geospatial development in Python.
More specifically, we will cover:
Python libraries for reading and writing geospatial data
Python libraries for dealing with map projections
Libraries for analyzing and manipulating geospatial data directly within your Python programs
Tools for visualizing geospatial data
Note that there are two types of geospatial tools which are not discussed in this article: geospatial databases and geospatial web toolkits. Both of these will be examined in detail later in this book.Read Python Libraries for Geospatial Development in full
The previous article, Python Multimedia: Fun with Animations using Pyglet, introduced you to the fundamentals of developing animations using Python and Pyglet multimedia application development frameworks.
In this article by Ninad Sathaye, author of Python Multimedia Beginner's Guide, we will:
- Work on a project, 'Bowling animation', where animations can be controlled using inputs from the keyboard.
- Develop relevant code to create an animation using different regions of a single image.
- Work on an exciting project that animates a car moving in a thunderstorm. This project deals with many important things covered throughout this article.
Python is a high-level, object-oriented language with a comprehensive standard library. Typically, one can develop complex applications in Python very quickly compared to some other languages. Multimedia applications are used in a broad spectrum of fields. Writing applications that work with images, videos, and other sensory effects is great. Not every application gets to make full use of audio/visual effects, but a certain amount of multimedia makes any application very appealing.
In this article by Ninad Sathaye, author of Python Multimedia, we shall cover the following recipes:
- Adjusting brightness and contrast
- Swap colors within an image
- Change the color of a flower
Animation is a sequence of frames displayed quickly one after the other. This creates an optical illusion where the objects, for instance, appear to be moving around. This article by Ninad Sathaye, author of Python Multimedia Beginner's Guide, will introduce you to the fundamentals of developing animations using Python and Pyglet multimedia application development frameworks. Pyglet is designed to do 3D operations, but we will use it for developing very simple 2D animations in this article. Specifically, we will:
- Learn the basics of Pyglet framework. This will be used to develop code to create or play animations.
- Learn how to play an existing animation file and create animations using a sequence of images.
Photographs capture the moment, but it is the video that helps us relive that moment! Video has become a major part of our lives. We preserve our memories by capturing the family vacation on a camcorder. When it comes to digitally preserving those recorded memories, the digital video processing plays an important role. We will use GStreamer for learning the fundamentals of video processing..
In this article by Ninad Sathaye, author of the book Python Multimedia Beginner's Guide, we shall:
- Develop a simple command-line video player
- Perform basic video manipulations such as cropping, resizing, and tweaking the parameters such as brightness, contrast, and saturation levels of a streaming video
- Learn how to convert video between different video formats
So let's get on with it.Read Python Multimedia: Video Format Conversion, Manipulations and Effects in full
Decades ago, silent movies lit up the screen—but later, it was audio effect that brought life into them. We deal with digital audio processing quite frequently—when just playing a CD track, recording your own voice or converting songs into a different audio format. There are many libraries or multimedia frameworks available for audio processing. This article teaches some common digital audio processing techniques using Python bindings of a popular multimedia framework called GStreamer.
In this article by Ninad Sathaye, author of Python Multimedia, we shall:
- Learn basic concepts behind GStreamer multimedia framework
- Use GStreamer API for audio processing
- Develop some simple audio processing tools for 'everyday use'. We will develop tools that will batch convert audio file formats, record an audio, and play audio files
Coverage analysis is measuring which lines in a program are run and which lines aren't. This type of analysis is also known as 'code coverage', or more simply 'coverage'.
In this article by Greg Lee Turnquist, author of Python Testing Cookbook, we will cover:
- Building a network management application
- Installing and running coverage on your test suite
- Generating an HTML report using coverage
- Generating an XML report using coverage
- Getting nosy with coverage
The Robot Framework is a useful framework for writing acceptance tests using the keyword approach. Keywords are short-hand commands that are provided by various libraries and can also be user defined. This easily supports BDD-style Given-When-Then keywords. It also opens the door to third-party libraries defining custom keywords to integrate with other test tools, such as Selenium. It also means acceptance tests written using Robot Framework aren't confined to web applications.
This article by Greg Lee Turnquist, author of Python Testing Cookbook, shows all the steps needed to install the Robot Framework as well as the third party Robot Framework Selenium Library.Read Python Testing: Installing the Robot Framework in full
In this article by Daniel Arbuckle, author of Python Testing, we shall:
- Examine the ideas of mock objects in general
- Learn how to use Python Mocker
- Learn how to mock the "self" parameter of a method
Natural Language Processing is used everywhere—in search engines, spell checkers, mobile phones, computer games, and even in your washing machine. Python's Natural Language Toolkit (NLTK) suite of libraries has rapidly emerged as one of the most efficient tools for Natural Language Processing.
In this article by Jacob Perkins, author of the book Python Text Processing with NLTK 2.0 Cookbook, we will cover:
- Setting up a custom corpus
- Creating a word list corpus
- Creating a part-of-speech tagged word corpus
- Creating a chunked phrase corpus
- Creating a categorized text corpus
- Creating a categorized chunk corpus reader
- Lazy corpus loading
- Creating a custom corpus view
- Creating a MongoDB backed corpus reader
- Corpus editing with file locking