Question: I need to add a caption to each image. But the caption needs to be within a grey box next to the slider. You can see an example of the idea here:
<http://pagedev.co.uk/richmond/show-open.html>

Basically every image needs to have a title, oil on canvas and size tag. But it needs to change with every image.

Hopefully someone can help me. You should be able to check the code using the link above, but if you need anything let me know and ill post it up.

Thank you in advance.

Lee

Answer: 
You should try using a `dictionary` for that:

```
fl = str(input('Enter text wanted evaluated: '))

with open(fl, 'r') as f:
f = f.read().split('\n')

f_dict = {}

for i in f:
    i = i.split()
    if i[0] in f_dict:
        f_dict[i[0]].append(i[2])
    else:
        f_dict[i[0]] = [i[2]]

a = []
for i in f_dict:
    for j in f_dict.values():
        if i in j:
            break
        a.append(i)

a = list(set(a))

for i in f_dict:
    print i+' eats '+', '.join(f_dict[i])

print('')
print('Never Eaten')
for i in a:
    print i

[Out]:
a eats b, d, c
c eats d
b eats c, d

Never Eaten
a

```
Steps:

1. Open file and read each line, splitting by `'eats'`.
2. Append the first value to a list named `predator`, if it hasn't already been in `prey` (if it hadn't been the 2nd value), and if it is in `predator` and it is is prey, remove it from `predator` and at it to `prey`.
3. Print all the values in `predator`.

```
open('file.txt')
predators = []
eaten = []
for lines in file:
    lines = lines.split('eats')
    predator, prey = lines
    if predator not in eaten:
        predators.append(predator)
    if prey in predator:
        del(predator[prey])
    eaten.append(prey)
print 'Never eaten:'
for k in predators:
    print k

```

Runs as:

```
Never eaten:
a

```