title: Is there any way to pass values to input prompt to the python script which was called by other python script?
body: <p>For better understanding,</p>
  <p><strong>example2.py</strong></p>
  <pre><code>    a = raw_input(&quot;Enter 1st number: &quot;)
      b = raw_input(&quot;Enter 2nd number: &quot;)
      *some code here*
      c = raw_input(&quot;Enter 3rd number: &quot;)
      s = a+b+c
      print(s)
  </code></pre>
  <p><strong>example1.py</strong></p>
  <pre><code>    import os
      os.system('python example2.py')
      &lt;need logic to address the input prompts in example2.py&gt;
      &lt;something to pass like **python example2.py 1 2 3**&gt;
  </code></pre>
  <p>I guess by looking at these scripts you can get it what I'm looking for? Let me explain it once for a better understanding. There are two files <code>example1.py</code> and <code>example2.py</code>. Now, I called <code>example1.py</code> from my shell, which in turn called the other script and waiting for the input.</p>
  <p>Notes:</p>
  <ul>
  <li>I can't do anything on <code>example2.py</code>, which is not owned by me.</li>
  <li>I'm limited to do changes on <code>example1.py</code> and pass arguments to <code>example1.py</code></li>
  <li>I know there will be a process created for <code>example2.py</code>, but not sure about passing these arguments to process IO.</li>
  <li>Actual code was different, I crafted <code>example1.py</code> and <code>example2.py</code> for the sake of understanding.</li>
  </ul>
  <p>I couldn't grasp any ideas from these links:</p>
  <p><a href="https://stackoverflow.com/questions/48395685/launch-a-python-script-from-another-script-with-parameters-in-subprocess-argume">Launch a python script from another script, with parameters in subprocess argument</a></p>
  <p><a href="https://stackoverflow.com/questions/4230725/how-to-execute-a-python-script-file-with-an-argument-from-inside-another-python">how to execute a python script file with an argument from inside another python script file</a></p>
  <p>Please share your thoughts on this and help me to resolve this. Please don't mind editing the question if it requires. I'm completely new to the module <code>os</code>, <code>subprocess</code>.</p>