title: How to Run a Python Program that Takes Command-Line arguments from within a Java Program
body: <p>I understand that to run another Java program from inside a Java program you use something like this:</p>
  
  <pre><code>Runtime.getRuntime().exec("/**A command goes here*/")
  </code></pre>
  
  <p>But how would I run a Python program that takes command-line arguments?
  More specifically, my Java program takes a file as a command-line argument. I then pass this file in to a Python program, which then produces another file in the same directory. I will be  able to access this new file. </p>
  
  <p>Can I simply call:</p>
  
  <pre><code>Runtime.getRuntime().exec("python /**directory_of_the_python_program arguments_for_program*/");
  </code></pre>
  
  <p>I'm also a bit confused about what goes inside "exec(...)". </p>