-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFindaKeyTest.py
More file actions
38 lines (33 loc) · 1.33 KB
/
FindaKeyTest.py
File metadata and controls
38 lines (33 loc) · 1.33 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
import os
def fileList(highest_directory):
file_list = []
print os.walk(highest_directory)
#print os.stat(highest_directory)
base_dir = os.path.dirname(highest_directory)
print highest_directory
print base_dir
print os.path.relpath(highest_directory, test_dir)
print os.path.normpath(highest_directory) # Doesn't seem to do anything useful- actually this is useful. Normalises the way of describing the delimiters removing edge cases
print os.path.split(highest_directory)
'''
for path, subdirs, files in os.walk(highest_directory):
print path
print subdirs
'''
'''
for name in files:
#file_list.append(os.path.join(path, name))
print path
print name #Can this be used as a key for the dictionary (i.e. is it unique to each run?)- NO
'''
'''
if name in file_list:
print "Duplicate"
break
'''
#file_list.append(name)
#return file_list
folder_h = "C:\\Users\\Sara\\Google Drive\\MScProjectExtras\\ExtraDataForDatabase\\160224_M02641_0082_000000000-ALPHF\\"
folder_h = "C:\\Users\\Sara\\Documents\\Before\\160520_M00766_0034_000000000-ANJEU\\"
test_dir = "C:\\Users\\Sara\\Documents\\Before\\160520_M00766_0034_000000000-ANJEU\\Data\\Intensities\\"
print fileList(folder_h)