1. Home
  2. Computing & Technology
  3. Python

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

From , former About.com Guide

3 of 8

Getting the Feed's URL for Python to Retrieve

One of the basic attributes of any feed is its address. For that, we will use a function that calls the address out of feedinfo. The code looks like this:

def feeddata (self, feedname):
     feedaddress = feedinfo[feedname]
    return feedaddress

Here the function feeddata receives the variable feedname. It then accesses the dictionary feedinfo and asks for the the value of that key. The value is then assigned to feedaddress and passed back to the calling function.

If you need a refresher on functions, refer back to my tutorial.

Explore Python
About.com Special Features

Holiday Central

What to eat, where to go, fun things to do and how to save money on the perfect gifts. More >

Family Tech Center

Stay connected and entertained with reviews on tips on the latest HDTVs, cellphones and more. More >

  1. Home
  2. Computing & Technology
  3. Python

©2009 About.com, a part of The New York Times Company.

All rights reserved.