Basically, if I have a line of text which starts with indention, what\'s the best way to grab that indention and put it into a variable in Python? For example, if the line i
A sneaky way: abuse lstrip!
lstrip
fullstr = "\t\tthis line has two tabs of indentation" startwhites = fullstr[:len(fullstr)-len(fullstr.lstrip())]
This way you don't have to work through all the details of whitespace!
(Thanks Adam for the correction)