title: Adding a data file in Pyinstaller using the onefile option
body: <p>I'm trying to add an image to the one file produced by Pyinstaller. I've read many questions/forums like this <a href="https://stackoverflow.com/questions/36342302/pyinstaller-onefile-not-including-data-files">one</a> and that <a href="https://stackoverflow.com/questions/7674790/bundling-data-files-with-pyinstaller-onefile/7675014#7675014">one</a> and still it's not working.</p>
  
  <p>I know that for one file operation, Pyinstller produce a temp folder that could be reached by <code>sys.MEIPASS</code>. However I don't know <strong><em>where exactly in my script I should add this</em></strong> <code>sys.MEIPASS</code>.</p>
  
  <p>Kindly show the following:</p>
  
  <p>1- <strong><em>Where and how</em></strong> <code>sys.MEIPASS</code> should be added? In the python script, or in the spec file?</p>
  
  <p>2- What is the exact command to use? I've tried </p>
  
  <pre><code>pyinstaller --onefile --windowed --add-data="myImag.png;imag" myScript.py
  </code></pre>
  
  <p>or</p>
  
  <pre><code>pyinstaller --onefile --windowed myScript.py
  </code></pre>
  
  <p>and then add ('myImag.png','imag') to the spec file and then run </p>
  
  <pre><code>pyinstller myScript.spec
  </code></pre>
  
  <p>None has worked. </p>
  
  <p>Note: I have python 3.6 under windows 7</p>