To begin with, the indentation is wrong.
message is a string object. String method
split() is used to break the string into parts using whitespace as a delimiter.
- >>> s = "A simple\tstring\nobject."
-
>>> s
-
'A simple\tstring\nobject.'
-
>>> print s
-
A simple string
-
object.
-
>>> s.split()
-
['A', 'simple', 'string', 'object.']
-
>>>
The code expects element 1 ('simple' in the example above) to be the name of a file object with an unwanted prefix character.
- >>> fn = s.split()[1]
-
>>> fn[1:]
-
'imple'
-
>>>
A file object is created with built-in function
open() and read with file object method
read().
Really, this is very basic Python. All this information is readily available in the Python documentation. A good place to start is
python.org.