1. Technology

Part 3: Creating a Feed Class and Finishing the Python Program


2 of 8

Making a Model RSS Feed With Python

From my tutorial on classes, you know that a class is a blueprint for software objects. Object-oriented programming is a major boon for programmers, and Python's object-orientation makes development very easy. For this tutorial we will develop the blueprint for what RSS feed objects look like. It will not be as comprehensive as it could, but then we do not need it to be.

The name of the class for our model feed will be, appropriately, ModelFeed. While self-definition is not always necessary in one's class, it is a good practice to have. So let's begin our class definition and its first function.
 class ModelFeed: 
 def __init__(self): 
      self.data = [] 

Again, if you have any questions or do not understand what I have done here, see my tutorial on classes. Otherwise, let us move on to the the finer parts of the class.

  1. About.com
  2. Technology
  3. Python
  4. Web Development
  5. RSS Reader in Python - Building an RSS Reader With Python - Creating a Feed Class and Finishing the Python Program

©2014 About.com. All rights reserved.