Invoke An Editor ( Vim ) In Python
Is there a way to communicate with vim in python? I mean, I am wring a small software using python, it has a facility of memo, so when I want to write some memo, the software shou
Solution 1:
Check my answer about invoking $EDITOR
on the content of your choice:
call up an EDITOR (vim) from a python script. That's how git and others do that: write an initial content up in temporary file, fire $EDITOR
on it, wait for the process to exit and then read the new content, parsing it. To provide syntax colouring or other niceties, usually a 'contrib' package is provided and has nothing to do with the functionality of the program itself.
Solution 2:
Here's how git determines which editor to use. After that, you could just open a new process with the subprocess module.
Post a Comment for "Invoke An Editor ( Vim ) In Python"