9 print('usage: %s [-O] <input.py> [args...]' % sys
.argv
[0])
14 gcc_flags
= ['-g', '-Wall']
16 if args
and args
[0] == '-O':
19 if args
and args
[0] == '-q':
27 base
= os
.path
.splitext(path
)[0]
30 subprocess
.check_call(['python3', 'transform.py', path
, '%s.cpp' % base
])
31 elapsed
= time
.time() - start
33 print('Transform time: %.4fs' % elapsed
)
36 subprocess
.check_call(['c++'] + gcc_flags
+ ['%s.cpp' % base
, '-o', base
])
37 elapsed
= time
.time() - start
39 print('Compile time: %.4fs' % elapsed
)
42 subprocess
.check_call(['./%s' % base
] + args
[1:])
43 elapsed
= time
.time() - start
45 print('Run time: %.4fs' % elapsed
)