Playing about with python I thought about trying to write a program that gets a simple text file eg. hello %s, and using an adress book, loops through it, changing the %s every time into the next name in the adress book, using a queue.
But it just doesn't want to work.
AdressBook = ['Eve', 'Bob', 'Mike', 'Tom', 'Jane'] for x in AdressBook: print x, '\n' f = open('C:\Documents and Settings\Henry\My Documents\Python_Stuff\Letter.txt', 'r+') for a in AdressBook: x = AdressBook.index(0) for i in f: print i % (x) AdressBook.pop(0)
When I run this, it says:
Traceback (most recent call last): File "C:/Documents and Settings/Henry/My Documents/Python_Stuff/AB_LF.py", line 10, in <module> x = AdressBook.index(0) ValueError: list.index(x): x not in list