The answers to this question did not get into the core of the problem. In CLI-based Python, I want the user to be able to edit the file and then return to the program. Before returning, I want them to be able to undo their changes. This should look like a commit commit function in Subversion.
What are the current best practices for this type of task?
You can try looking at sources in Mercurial written in Python.
os.environ HGEDITOR, VISUAL EDITOR, vi. os.system , tempfile.mkstemp. , . , , .
os.environ
HGEDITOR
VISUAL
EDITOR
os.system
tempfile.mkstemp
, Mercurial , ui.py util.py.
Subversion $EDITOR, , . , $EDITOR , unixy . - Windows (cmd /c start tempfile.txt) Mac OS X (open tempfile.txt).
cmd /c start tempfile.txt
open tempfile.txt
, , .
"" , . , , . , Subversion.