I want to send some inputs to a cmd based programme using python. The program takes normally type inputs from keyboard.
I tried as:
P1=subprocess.Popen("my_program",stdin=subprocess.PIPE,stdout=subprocess.PIPE,sterr=subprocess.PIPE)
p1out,p1err=P1.communicate(input="my_input")
But gave error as "it requires byte like object not str". I had also tried with P1.stdin.write() method and gave same error again. What should be my input dtype?
encoding='utf-8'when you callPopen