1 | initial version |
Subprocess is somewhat baroque, but you could make a convenience function and put it in your init.sage file, e.g.:
import subprocess def make_it_so(acommand): ''' Uses subprocess module to return the output of a shell command ''' return subprocess.Popen(acommand,shell=True,stdout=subprocess.PIPE).communicate()[0]
and then sage: make_it_so('pwd') '/Users/mh\n'
2 | No.2 Revision |
Subprocess is somewhat baroque, but you could make a convenience function and put it in your init.sage file, e.g.:
import subprocess
def make_it_so(acommand):
'''
Uses subprocess module to return the output of a shell command
'''
return and then
sage: make_it_so('pwd')