I'd like to open an editor (cli or gui-based) via Python script. I can do this with os.system('vim file'), but I'd also like to get output in case command fails. subprocess.getstatusoutput('vim file') doesn't work for opening programs with specific interface.
What's the best alternative?
os.environ['EDITOR']and not start some editor you choose.ed httpdand it will runvim -arg1 -arg2 /etc/httpd/conf/httpd.conf