RosettaCodeData/Task/Find-common-directory-path/Python/find-common-directory-path-1.py

5 lines
191 B
Python
Raw Permalink Normal View History

2013-04-10 21:29:02 -07:00
>>> import os
>>> os.path.commonprefix(['/home/user1/tmp/coverage/test',
'/home/user1/tmp/covert/operator', '/home/user1/tmp/coven/members'])
'/home/user1/tmp/cove'