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?
will raise an
OSErrorexception ifEDITORfails to run.