Book Image

Raspberry Pi Essentials

By : Jack Creasey
Book Image

Raspberry Pi Essentials

By: Jack Creasey

Overview of this book

Table of Contents (15 chapters)
Raspberry Pi Essentials
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Project 2c – Parsing the playlist file for the Internet radio


Now that we have the playlist file defined and have added some entries, you need to be able to read the file and build the internal data structures that will be used to hold station data in the Internet radio. You can download the parse.py file and the Chapter 4 supplemental materials document from http://1drv.ms/1ysAxkl. The methodology for testing parse.py is available in the Chapter 4 supplemental materials.

The parse.py program will do the following actions:

  • Open and read the Internet station streams we want from a file called /home/radio/playlistPrints out of a numerical list of the stations in the playlist file

  • Print out the station list python list[], which is used later to allow access to the entries.