I’m writing a bash script that fires up python and then enters some simple commands before exiting. I’ve got it firing up python ok, but how do I make the script simulate keyboard input in the python shell, as though a person were doing it?
Share
Use a “here” document. It looks like this
You don’th have to use “HERE”, you can use something that has a little more
meaning relative to the context of your code.