Advertisement
atm-irbis

Mopac automatization

Mar 4th, 2013
427
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.60 KB | None | 0 0
  1. import subprocess,datetime
  2.  
  3. def startup(file):
  4.     z = open(file,'r')
  5.     # время начала запуска
  6.     start = datetime.datetime.now().replace(microsecond=0)
  7.     for i in z:
  8.         v = ['/opt/mopac/MOPAC2012.exe',i]
  9.         subprocess.check_output(v)
  10.     # конечное время
  11.     stop = datetime.datetime.now().replace(microsecond=0)
  12.     z.close()
  13.     return str(stop - start)
  14.  
  15. # сколько времени понадобилось на расчет всех задач из файла /home/recrait/task.txt
  16. print 'Execution time: ' + startup('/home/recrait/task.txt')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement