-
Notifications
You must be signed in to change notification settings - Fork 0
/
full_dir.py
48 lines (34 loc) · 885 Bytes
/
full_dir.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
import shutil
old_path = os.getcwd()
#print(old_path)
list = []
energy_file = "Energy.txt"
with open(energy_file) as f:
data = f.readlines()
for lines in data:
dir = lines[:13]
dir_split = dir.split(" ")
ful_dir = dir_split[0]+".dlg"
list.append(ful_dir)
result = list
#print(result)
if os.path.exists(old_path + "/" + "full_dir"):
for item in result:
path = old_path+"/"+item
#print(path)
if os.path.exists(path):
#print(item)
new = old_path+"/full_dir"
os.chdir(new)
shutil.copy(path, new)
else:
os.mkdir("full_dir")
for item in result:
path = old_path + "/" + item
#print(path)
if os.path.exists(path):
#print(item)
new = old_path + "/full_dir"
os.chdir(new)
shutil.copy(path, new)