The argument passed to lstrip
is taken as a set of characters!
>>> ' spacious '.lstrip()
'spacious '
>>> 'www.example.com'.lstrip('cmowz.')
'example.com'
See also the documentation
You might want to use str.replace()
str.replace(old, new[, count])
# e.g.
'/Volumes/Home'.replace('/Volumes', '' ,1)
Return a copy of the string with all occurrences of substring old replaced by new. If the optional argument count is given, only the first count occurrences are replaced.
For paths, you may want to use os.path.split()
. It returns a list of the paths elements.
>>> os.path.split('/home/user')
('/home', '/user')
To your problem:
>>> path = "/vol/volume"
>>> path.lstrip('/vol')
'ume'
The example above shows, how lstrip()
works. It removes '/vol' starting form left. Then, is starts again...
So, in your example, it fully removed '/Volumes' and started removing '/'. It only removed the '/' as there was no 'V' following this slash.
HTH