I wanted to know what is the pythonic function for this :
I want to remove everything before the wa
path.
p = path.split('/')
counter = 0
while True:
if p[counter] == 'wa':
break
counter += 1
path = '/'+'/'.join(p[counter:])
For instance, I want '/book/html/wa/foo/bar/'
to become '/wa/foo/bar/'
.
os.path
module – Augustine