I am reading a file in python and getting the lines from it. However, after printing out the values I get, I realize that after each line there is a trailing \ at the end. I have looked at Python strip with \n and tried everything in it but nothing has removed the trailing . For example
0048\
0051\
0052\
0054\
0056\
0057\
0058\
0059\
How can I get rid of these slashes?
Here is the code I have so far
for line in f:
line = line.replace('\\n', "")
line = line.replace('\\n', "")
print(line)
I've even tried using regex
strings = re.findall(r"\S+", f.read())
But nothing has worked so far.