How to get Base common folder from list of folder using Python?
Question:
THere is a list of file names from several folders/subfolders (Same drive). Example :
C:TestGOabc.csv
C:TestTEST2TER.abc.csv
C:TestCARabc.cvs
I need to get ‘C:Test’ as the shared root folder of the list of the above files. Is there any python function already there ?
Answers:
os.path.commonpath(["C:Test...", "..."])
THere is a list of file names from several folders/subfolders (Same drive). Example :
C:TestGOabc.csv
C:TestTEST2TER.abc.csv
C:TestCARabc.cvs
I need to get ‘C:Test’ as the shared root folder of the list of the above files. Is there any python function already there ?
os.path.commonpath(["C:Test...", "..."])