I am trying to run a text editor (nano) from within Python, ask the user to enter text, and then capture the text after they are written (Control-O). I have not worked with the module subprocessbefore, nor pipes, so I do not know what to try next.
So far I have this code:
a = subprocess.Popen('nano', stdout=subprocess.PIPE, shell=True)
Where ashould I capture the conclusion. This code, however, does not call nano, but instead makes the python terminal behave strangely. The Up and Down keys (history) stop working, and the Backspace key becomes dysfunctional.
Can someone point me in the right direction to solve this problem? I understand that I may have to read on pipes in Python, but the only information I can find is the module pipes, and that doesn't help much.
source
share