-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathsample2.py
More file actions
29 lines (24 loc) · 852 Bytes
/
sample2.py
File metadata and controls
29 lines (24 loc) · 852 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
import os
filepath = os.getcwd()
backslash = "\\"
allfiles = os.listdir(filepath)
filelist=len(allfiles)
i,j=0,0
dirdir, filedir=[], []
for indexval in range(filelist):
#print "File ", indexval, allfiles[indexval], type(allfiles[indexval])
checkfileisdir = filepath + backslash + allfiles[indexval]
if os.path.isdir(checkfileisdir):
print "directory no ", i, " ",allfiles[indexval]
dirdir.append(checkfileisdir)
i+=1
else:
print "file no ", j, " ", allfiles[indexval]
j+=1
filedir.append(checkfileisdir)
pickfilechoice=input("Enter your directory choice in numbers and the file to move :")
print "moving {0} file to {1}",(pickfilechoice)
# to do the same thig as above with map function
pathstr=filepath + backslash
print allfiles, pathstr
#print map(pathstr+=allfiles, allfiles)