Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import os.path
- paths = ['/one/two/three/four',
- '/one/two/threefold',
- '/one/two/three/',
- ]
- for path in paths:
- print 'PATH:', path
- print
- print 'PREFIX:', os.path.commonprefix(paths)
Advertisement
Add Comment
Please, Sign In to add comment