Opening an editor for interactive use

Webb webb.sprague at gmail.com
Fri Jun 16 19:55:16 CEST 2006


Hi all,

(I am sure there is a recipe somewhere, but I can't find it.)  How does
one open an editor while in the middle of an interactive program, let
the user do some editing and closing, and then capture the text that
was edited?  I am reminded of subversion or CVS when they open an
$EDITOR session for the check-in log entry.

I tried os.popen, but it fired off vim in the background--not useful.
Then I tried os.system, but that only returns the return code (126 in
my case) after you close the editor.  Perhaps I need to write to a file
and read it--shouldn't there be a cleaner way?

Thanks
W




More information about the Python-list mailing list