Python script to give input to exe
Question: I am able to open cmd.exe using script

    
    
    import subprocess
    subprocess.call("C:\Windows\System32\cmd.exe",shell=True)
    

But I am unable to send input command to cmd.exe open. I want to achieve
something like below mentioned using script

1) script give input command like `python` to cmd.exe open [![enter image
description
here](http://i.stack.imgur.com/FH3MJ.png)](http://i.stack.imgur.com/FH3MJ.png)

2) After that script give input command like `print "hello"` to python prompt
comes [![enter image description
here](http://i.stack.imgur.com/DvteW.png)](http://i.stack.imgur.com/DvteW.png)


Answer: Why not use Python to create a batch file that prints what you want, then
execute that batch file? You could either return immediately or keep the
command interpreter open: it depends on the command switches you use to run
the batch file.

