Advertisement
atm-irbis

'Run Python file' plugin for Medit

Feb 17th, 2013
559
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.38 KB | None | 0 0
  1. import moo
  2.  
  3. class Run:
  4.     def __init__(self):
  5.         self.fname = doc.get_filename()
  6.     def push(self):
  7.         import subprocess
  8.         self.out = subprocess.check_output(['python','-u',self.fname])
  9.         return self.out
  10.  
  11. r = Run()
  12. out = r.push()
  13. if str(out) != '':
  14.     moo.info_dialog('Python says:', secondary_text=out, parent=None)
  15. else:
  16.     pass
  17. del r,out
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement