1. Technology

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

By

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.

  1. About.com
  2. Technology
  3. Python
  4. Web Development
  5. RSS Reader in Python - Building an RSS Reader With Python - Getting the Feed's URL for Python to Retrieve

©2014 About.com. All rights reserved.