I try to parse the ini-file ( file
variable), but when accessing by index, an exception occurs:
contFile = file.readlines() print(contFile) # ['[MAIN]\r', '\r\n', 'comments=Test1\r\n'] cont = contFile[1].split('=')[1] # IndexError: list index out of range
Question: How to get rid of '\r\n'
in the list? There is a feeling that they interfere with the execution of the program.