Python for Android: Using Webviews (SL4A)

Webviews make it easy to use web technologies to build graphical user interfaces for native applications. Many people already know some webcraft, and it’s easy to pick up and well worth knowing, so there’s a broad appeal in being able to use these technologies for native apps. This also allows developers to tap into the […]

Read More

Recursive File and Directory Manipulation in Python (Part 3)

In Part 2 of this series we expanded our file-searching script to be able to search for multiple file extensions under a tree, and to write the results (all paths to files of matching extensions found) to a log file. Now that we’ve come to the final part of the series, we’ll add more functionality […]

Read More

Activate Admin Application for Your Python Django Website

In the previous article , we learned how to write two models Post and Comment for your Django application myblog. In this article, we are going to learn how to activate Django’s automatic admin site that provides a convenient interface for users or administrators of your website myblog to create, read, update and delete (CRUD) […]

Read More

Writing Models for Your First Python Django Application

The previous article Writing Your First Python Django Application is a step-by-step guide on how to write a simple Django application from scratch. In this article, you will learn how to write models for your new Django application. Software Architectural Patterns Before we dive into the code, let’s review two of the most popular server-side […]

Read More

Recursive File and Directory Manipulation in Python (Part 2)

In Part 1 we looked at how to use the os.path.walk and os.walk methods to find and list files of a certain extension under a directory tree. The former function is only present in the Python 2.x, and the latter is available in both Python 2.x and Python 3.x. As we saw in the previous […]

Read More

Introduction to Python’s Django

What is Web Development Web development is a broad term for any work that involves creating a web site for the Internet or an intranet. The end product of a web development project varies from simple sites composed of static web pages to complex applications that interact with databases and users. The list of tasks […]

Read More

PySide/PyQt Tutorial: The QListWidget

Qt has a couple of widgets that allow single-column list selector controls — for brevity and convenience, we’ll call them list boxes. The most flexible way is to use a QListView, which provides a UI view on a highly-flexible list model which must be defined by the programmer; a simpler way is to use a […]

Read More

PySide/PyQt Tutorial: Creating Your Own Signals and Slots

You don’t have to rely solely on the signals that are provided by Qt widgets, however; you can create your own. Signals are created using the Signal class. A simple signal definition would be: Then, when the conditions for the object being tapped are satisfied, you call the signal’s emit method, and the signal is […]

Read More

Real-World Regular Expressions for Python

We’ve covered a lot of ground in this series of articles, so let’s now put it all together and work through a real-life application. A common task is to parse a Windows INI file, which are key/value pairs, separated into sections, something like this: [python] [Section 1] val1=hello world val2=42 [Section 2] val1=foo! [/python] Let’s […]

Read More

More About Python Regular Expressions

In the first part of this series, we looked at the basic syntax of regular expressions and some simple examples. In this part, we’ll take a look at some more advanced syntax and a few of the other features Python has to offer. Regular Expression Captured Groups So far, we’ve searched within a string using […]

Read More