My using python only occasionally; so I understand the basic concepts; but today I ran into a piece of code ... that I simply don't understand:
I was looking for an efficient way to do "find" via python; and this SO question shows this answer:
paths = [line[2:] for line in subprocess.check_output("find . -iname '*.txt'", shell=True).splitlines()]
And yes, it works for me; and is much faster compared to os.walk; so I intended to use it. But I have to admit: I don't understand what it is doing; especially the 'line[2:]' part ... wtf?!
I tried to use google/so to find the answer; well, searching for "python line" didn't help at all ... so, probably stupid question: what does it mean?