-
Notifications
You must be signed in to change notification settings - Fork 2
/
foder.py
37 lines (26 loc) · 865 Bytes
/
foder.py
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
import os
'''
folder_path = 'C:/Users/Administrator/AppData/Roaming/Blender Foundation/Blender/2.90/scripts/addons/AutoMech/Preset'
#path = folder_path.replace("/", "/")
path = os.path.realpath(folder_path)#soft os.path.abspath
os.startfile(path)
for filename in os.listdir(os.getcwd()):
#with open(os.path.join(os.getcwd(), filename), 'r')
print(os.path.join(os.getcwd(), filename))
FileList=''
for filename in os.listdir(os.getcwd()):
#with open(os.path.join(os.getcwd(), filename), 'r')
FileList+=' '+filename
print(FileList)
'''
FileList=[]
for file in os.listdir(os.getcwd()):
#with open(os.path.join(os.getcwd(), filename), 'r')
filename=file.split('.', 1)
if len(filename[0]) < 1:
FileList.append(filename[1])
else:
FileList.append(filename[0])
print(len(FileList))
#for i in FileList:
#print(i)