String formatting problem.

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.

I'm confuzzled by your code. Do you know what list.index(x) does? It returns the index of item x in the list. If you were hoping to retrieve the first item of the AdressBook list (by the way you spelled Address wrong), you should be using slicing AdressBook[0] or even simply use pop, as that will return the value that gets removed.

So basically I'd change your final loop like so:

for a in AdressBook:
x = AdressBook.pop(0)
for i in f:
print i % (x)

But this raises the question, why are you popping from the Address book? Why not just simply iterate over it and use those values? ie,

for addy in AddressBook:
print i % addy

I fail to see the point of iterating over your file (which I presume contains a single line containing '%s'). What is it that you're trying to achieve?