title: How to create 3 instances of command prompt in Windows and pass commands to each prompt in parallel using python
body: <p>I am using python 3.2 currently and I wanted to do write a code that generates 3 instances of command prompt in windows. I then need to access a different server in each of these command prompts using Plink (putty) and run a time consuming program in each of these command prompts in parallel. While I was able to create three instances of command prompts, I was not able to send commands to these prompts. Is there any method to do so? Should I use multiprocessing/ multithreading for this purpose? </p>
  
  <p>I wrote the following code for creating the command prompts. Is there any way to pass commands to each of these prompts? </p>
  
  <pre><code>def Plink():
      name = multiprocessing.current_process().name
      proc = subprocess.Popen("C:\\Windows\\System32\\cmd.exe")
  
  if __name__ == '__main__':
      Plink_1 = multiprocessing.Process(name='Plink 1', target=Plink)
      Plink_2 = multiprocessing.Process(name='Plink 2', target=Plink)
      Plink_3 = multiprocessing.Process(name='Plink 3', target=Plink)
  
      Plink_1.start()
      Plink_2.start()
      Plink_3.start()
  </code></pre>