title: Unable to write to stdin in subprocess
body: <p>i am unable to pass in commands to stdin in python 3.2.5. I have tried with the following 2 approaches
  Also: This question is a continuation of a <a href="https://stackoverflow.com/questions/17301571/calling-command-exe-with-python">previous question</a>. </p>
  
  <pre><code>from subprocess import Popen, PIPE, STDOUT
  import time
  
  p = Popen([r'fileLoc/uploader.exe'],shell = True, stdout=PIPE, stdin=PIPE, stderr=STDOUT)
  p.stdin.write('uploader -i file.txt -d outputFolder\n')
  print (p.communicate()[0])
  p.stdin.close()
  </code></pre>
  
  <p>i also get numbers such as 96, 0, 85 returned to me when i try the code in the IDLE interpreter, along with errors such as from the <code>print (p.communicate()[0])</code></p>
  
  <pre><code>Traceback (most recent call last):
    File "&lt;pyshell#132&gt;", line 1, in &lt;module&gt;
      p.communicate()[0]
    File "C:\Python32\lib\subprocess.py", line 832, in communicate
      return self._communicate(input)
    File "C:\Python32\lib\subprocess.py", line 1060, in _communicate
      self.stdin.close()
  IOError: [Errno 22] Invalid argument
  </code></pre>
  
  <p>i have also used: </p>
  
  <pre><code>from subprocess import Popen, PIPE, STDOUT
      import time
  
      p = Popen([r'fileLoc/uploader.exe'],shell = True, stdout=PIPE, stdin=PIPE, stderr=STDOUT)
      p.communicate(input= bytes(r'uploader -i file.txt -d outputFolder\n','UTF-8'))[0]
      print (p.communicate()[0])
      p.stdin.close()
  </code></pre>
  
  <p>but with no luck. </p>