Hello, I'm trying to start a text editor (nano) from inside Python, have the user enter text, and then capture the text once they writeout (Control-O). I haven't worked with the subprocess
module before, nor pipes, so I don't know what to try next.
So far I have this code:
a = subprocess.Popen('nano', stdout=subprocess.PIPE, shell=True)
Where a
should capture the output. This code, however, doesn't bring up nano, and instead makes the python terminal behave strangely. Up and down keys (history) stop working and the backspace key becomes dysfunctional.
Can someone point me in the right direction to solve this issue? I realize that I may need to read up on pipes in Python, but the only info I can find is the pipes
module and it doesn't help much.