title: Making exe-file from python with PySimpleGUI and pysimplegui-exemaker
body: <p>I made a simple Python3-program which uses PySimpleGUI to create a Windows-GUI-programm.
  This program contains also a picture CAESAR.png, which is in the same folder as my python-code.
  Here is the portion of the code for the layout:</p>
  <pre><code>import PySimpleGUI as sg
  
  
  layout = [[sg.Image('CAESAR.png')],
            [sg.Text(&quot;Geheime Nachricht in GROSSBUCHSTABEN eintippen:&quot;)],
            [sg.Multiline(size=(70,4),key=&quot;GEHEIM&quot;)],
            [sg.Spin([i for i in range(1,26)], initial_value=12, key=&quot;SS&quot;), sg.Text(&quot;Schlüssel zwischen 1 und 25 wählen&quot;)],
            [sg.Radio(&quot;Codieren:&quot;, &quot;RADIO1&quot;, key=&quot;XX&quot; ,default=True),
             sg.Radio(&quot;Decodieren:&quot;,&quot;RADIO1&quot;, key=&quot;YY&quot;)],
            [sg.Text(&quot;ERGEBNIS:&quot;)],
            [sg.Multiline(size=(70,4),key=&quot;AUSGABE&quot;)],
            [sg.Button(&quot;LOS&quot;), sg.Button(&quot;ENDE&quot;)]]
  
  window = sg.Window(&quot;Cäsars Geheimcode&quot;, layout)
  </code></pre>
  <p>This works ok so far. Now I want to make an windows-exe file with pysimplegui-exemaker (version 1.3):</p>
  <p>python -m pysimplegui-exemaker.pysimplegui-exemaker</p>
  <p>The compiled exe-file runs ok, when the picture CAESAR.png is in the same folder as the exe-file. If the picture is not in the same folder as the exe-file, I get an error-message.
  Question: How can I force pysimplegui-exemaker to &quot;embed&quot; the picture-file into the exe-file, so that this exe-file runs properly without the extra CAESAR.png in the same folder?</p>
  <p>according to the answer and link given by I @BhargavDesai did the following, to get a relativ path:</p>
  <pre><code>def resource_path(relative_path):
      &quot;&quot;&quot; Get absolute path to resource, works for dev and for PyInstaller &quot;&quot;&quot;
      base_path = getattr(sys, '_MEIPASS', os.path.dirname(os.path.abspath(__file__)))
      return os.path.join(base_path, relative_path)
  
  
  bild = resource_path(&quot;CAESAR.png&quot;)
  </code></pre>
  <p>Unfortunately the following steps given by the link did not work for me. any hints?</p>