-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmove-forms-pod1.py
More file actions
50 lines (34 loc) · 1.5 KB
/
Copy pathmove-forms-pod1.py
File metadata and controls
50 lines (34 loc) · 1.5 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
39
40
41
42
43
44
45
46
47
48
49
50
import os
import os.path
import shutil
#move this line to be right before the moving of file
#concatinate string so that uses counter to keep proper file name
#os.path.join(save_path,a)
list_of_files=[]
i=0
#os.chdir(".")
for dirpath, dirnames, filenames in os.walk("Pod1RepoTest"):
for filename in [f for f in filenames if f.startswith("forms") and f.endswith(".py")]:
obi=dirpath
list_of_files.append(filename)
b=filename.split(" (")
print(b)
print(b[1])
a=b[1].split(')')
print(a[0])
# save_path=r"C:\Users\capta\dev\LCSPods\FinalShowcaseGenerator\manage.py\Pod1"+r"\manage ("+str(b[1][0])+r").py"
# firstpart=r'C:\Users\capta\dev\LCSPods\FinalShowcaseGenerator'
#uncomment
save_path="C:\\Users\\capta\\dev\\LCSPods\\FinalShowcaseGenerator\\forms.py\\Pod1"+"\\forms ("+str(b[1][0])+").txt"
firstpart='C:\\Users\\capta\\dev\\LCSPods\\FinalShowcaseGenerator\\'
lastpart="\\forms ("+(a[0])+").py" #talk to nausher, figure way out to do it with py files
ligma=firstpart+obi+lastpart
#uncomment
#we'll do firstpart+obi+lastpart
#could be worth adding below path to save_path
#\manage ("+str(b[1][0])+r").py"
#save_path=r"C:\Users\capta\dev\LCSPods\FinalShowcaseGenerator\manage.py\Pod1"
#doesnt move the files to the desired directory when shutil is uncommented
#uncomment
dest=shutil.move(ligma,save_path)
i+=1