Skip to content

Instantly share code, notes, and snippets.

@gabraganca
Created April 3, 2013 15:21
Show Gist options
  • Save gabraganca/5302166 to your computer and use it in GitHub Desktop.
Save gabraganca/5302166 to your computer and use it in GitHub Desktop.
from subprocess import Popen, PIPE
def run_idl(inp, do_log = False):
"""Run IDL"""
if do_log:
with open('idl.log', 'w') as log:
idl = Popen(['nice','-n0','idl'],stdin = PIPE, \
stdout=log,stderr=log)
idl.communicate(inp)
else:
print '########### IDL ##################'
idl = Popen(['nice','-n0','idl'],stdin = PIPE)
idl.communicate(inp)
print '######## Quitting IDL ############'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment