title: How to pass user input automatically to a Python script?
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/4657900/how-to-write-in-stdout-after-to-call-a-method-doing-a-system-of-notifications-a">how to write in stdout after to call a method (doing a system of notifications automatic (Iphone))</a>  </p>
  </blockquote>
  
  
  
  <p>I have the following script, that I want to execute automatically in a django app. The issue is that it keeps asking for user input.</p>
  
  <p>I would like to know How to pass user input automatically? This is the script:</p>
  
  <pre><code>from apns import APNs, Payload
  
  apns = APNs(use_sandbox=True, cert_file='cert.pem', key_file='key.pem')
  
  # Send a notification
  token_hex = 'b5bb9d8014a0f9b1d61e21e796d78dccdf1352f23cd32812f4850b87'
  payload = Payload(alert="Hello World!", sound="default", badge=1)
  my_pass_phrase = 'efisgbieafb3939bg93g238g4792gff9'
  apns.gateway_server.send_notification(token_hex, payload)
  </code></pre>
  
  <p>The issue happens at the following line:</p>
  
  <pre><code>apns.gateway_server.send_notification(token_hex, payload)
  </code></pre>
  
  <p>The script asks: Enter PEM pass phrase: and waits for user input.</p>
  
  <p>I would like to know how to pass the pass phrase automatically. Thanks in advance!</p>