You do not need to call the splitlines () method on readline () results
file.readline () returns one line of the file, including the ending new line.
.splitlines () gets rid of the new line, using it as a separator and providing you with a list of lines with only one element. The brackets are taken from the str representation of this 1st list.
Do you want to:
x = f.readline().rstrip()
to delete a new line, or you can also cut the new line as follows
x = f.readline()[:-1]
, , - , . Python
for line in fileobject:
print line[:-1]
while .readline()