forked from AliceCodeZhang/sampleCode
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlistFile.py
More file actions
30 lines (28 loc) · 720 Bytes
/
Copy pathlistFile.py
File metadata and controls
30 lines (28 loc) · 720 Bytes
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
import os
from string import atoi
from itertools import islice
import sys, getopt, time
import psutil
import commands
import re
import os
'''
this python script is used for read result folder
'''
folder = 'report'
try:
opts, args = getopt.getopt(sys.argv[1:],"h:f:",["help", "folder="])
except getopt.GetoptError:
print 'error : listFile.py -f <folder>'
sys.exit(2)
for opt, arg in opts:
if opt in ("-h", "--help"):
print 'listFile.py -f <folder> \n'
elif opt == '-f':
folder = arg
else:
assert False, "unhandled option"
for dirname, dirnames, filenames in os.walk(folder):
for subdirname in dirnames:
print(os.path.join(dirname, subdirname))
print "aaa"