Advertisement
atm-irbis

gui Mopac automizer

Mar 4th, 2013
420
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.79 KB | None | 0 0
  1. # -*- coding: utf-8 -*-
  2. # TODO: довести тут кое что до ума
  3.  
  4. import guidata
  5. import guidata.dataset.datatypes as dt
  6. import guidata.dataset.dataitems as di
  7.  
  8. class MopacAuto(dt.DataSet):
  9.     mpath = di.StringItem("Mopac path:", default='/opt/mopac/MOPAC2012.exe')
  10.     wfile = di.StringItem("Task file:",default='')
  11.     def run_files(self):
  12.         if self.wfile == '':
  13.             raise IOError
  14.         else:
  15.             f = open(self.wfile,'r')
  16.             import subprocess
  17.             for i in f:
  18.                 p = [self.mpath,i]
  19.                 subprocess.check_output(p)
  20.             f.close()
  21.                
  22.        
  23. if __name__ == "__main__":
  24.     _app = guidata.qapplication()
  25.     param = MopacAuto()
  26.     e = param.edit()
  27.     if e:
  28.         param.run_files()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement