Not a python coder here. Can someone please explain (or even better link to something that explains) the bit in red.
MyVar = line.split()[B]<font color='"#FF0000"'>[4:-1]</font>[/B]
It is the slice operation (or substring) of a String.The red bit will return the 5th char to the to 2nd last char. (as everything is indexed from 0).
You can read through http://docs.python.org/2/tutorial/introduction.html