I have a text file that looks like this:
../../../../foo/bar
../../this/that
../barfoo
and I want:
foo/bar
this/that
barfoo
with open('file_list.txt', 'r') as file_list:
for file_list_lines in file_list:
file_list_lines.lstrip('../')
print(file_list_lines)
I tried .lstrip('../')
but nothing was stripped from the beginning of the line.