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

4 lines
181 B
Python
Raw Permalink Normal View History

2016-12-05 22:15:40 +01:00
>>> paths = ['/home/user1/tmp/coverage/test', '/home/user1/tmp/covert/operator', '/home/user1/tmp/coven/members']
>>> os.path.dirname(os.path.commonprefix(paths))
2013-04-10 21:29:02 -07:00
'/home/user1/tmp'