Skip to content Skip to sidebar Skip to footer

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:


Post a Comment for "Invoke An Editor ( Vim ) In Python"