-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtestscript.py
More file actions
44 lines (25 loc) · 903 Bytes
/
testscript.py
File metadata and controls
44 lines (25 loc) · 903 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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
import os
model_files_path = "/home/carpathy/Dropbox/ITB/MAC/ModelFiles"
mac_path = "/home/carpathy/Dropbox/ITB/MAC"
def clean_up(model, mac_path):
if os.path.isfile(model): os.system('rm '+model)
model = model.replace('.txt','')
if os.path.isfile(model+'_octave'): os.system('rm '+model+'_octave')
if os.path.exists(model):
os.system('rm '+model+'/*')
os.system('rmdir '+model)
def octave_test(model):
model = model.replace('.txt','')
text = 'cd '+model+' \r\n'
text += model + '_Sim'+'\r\n'
text += 'cd ../'+' \r\n'
text += 'exit'+' \r\n'
fileh = open(model+'_octave','w').write(text)
os.system('octave '+model+'_octave')
for model in os.listdir(model_files_path):
print '- '+model+' -'
clean_up(model, mac_path)
os.system('cp ModelFiles/'+model +' '+ model)
os.system('python2.6 MAC.py '+model)
#octave_test(model)
clean_up(model, mac_path)