title: QProcess passing arguments to a python Script
body: <pre><code>from PIL import Image
  def porcentaje(path):
  
      im = Image.open(path, "r")
      im.show()
      width, height = im.size
      type = im.mode
      format = im.format
      pixels=im.getdata()
      n = len(pixels)
     im=im.load()
     nblack = 0
     noblack=0
  
     for pixel in pixels:
         if pixel &lt; 50:
             nblack += 1
         else:
             noblack+=1
  
  porcentajefinal=(nblack*100)/n
  print(porcentajefinal)
  return(porcentajefinal)
  
  (porcentaje(path))
  </code></pre>
  
  <p>mainwindow.cpp (QT Creator)</p>
  
  <pre><code>void MainWindow::on_pushButton_2_clicked()
  {
  
      QString path = QFileDialog::getOpenFileName(this,
              tr("All Files (*)"));
       qDebug()&lt;&lt;path;
  
       QDir dir1("D:/QTCProjects/prueba");
       QFile file1("D:/QTCProjects/prueba/2_1.py");
       QString script1 = "D:/QTCProjects/prueba/2_1.py";
       QFile file2(script1);
  
       qDebug() &lt;&lt; dir1.exists() &lt;&lt; file1.exists() &lt;&lt; file2.exists();
         //  these all result in true, true true
       QProcess *myProcess = new QProcess();
       myProcess-&gt;start("python.exe D:/QTCProjects/prueba/2_1.py" );
       myProcess-&gt;waitForFinished(-1);
  
        qDebug() &lt;&lt; "myProcess:" &lt;&lt; myProcess-&gt;readAll(); }
  </code></pre>
  
  <p>This python requires a variable called path to run and i get this variable in qtcreator with Qstring path, how i can give python this variable with Qprocess.</p>