title: PyQt: How do resource files work?
body: <p>I just started creating GUI's in PyQt and I wanted to add <code>pixmap</code> as a background on buttons, as icons etc.</p>
  
  <p>And I have these questions:</p>
  
  <ol>
  <li><p>If I ever compile <code>.py</code> to <code>.exe</code>, how can I include folders with resource files and images in it?</p></li>
  <li><p>How can I import resource files in code? For example, I have a resource file, <code>Test.png</code>, how can I call it?</p>
  
  <p>class Window(QtGui.QMainWindow):</p>
  
  <pre><code>def __init__(self):
      super(Window, self).__init__()
      self.setGeometry(0, 0, 1280, 800)
      self.setWindowTitle("Window")
      self.setWindowIcon(QtGui.QIcon('Test.png')) # &lt; How can I import resource file here?
  </code></pre></li>
  <li><p>How can I generate resource files?</p></li>
  <li><p>If resource files and pictures are in same folder, do I still need to specify full path? </p></li>
  <li><p>What do I need, To organize Python code for a good application? (Do I need something other than resource file or Python code?)</p></li>
  <li><p>Why are they so useful? Do I still need the original picture when I generate a resource file, or does it compile every pixel as useful code?</p></li>
  </ol>