0

I'm trying to package this example PySide systray Application with py2app.

The app accesses a number of images to display as the systray icon's graphic, in a directory called images. The images are loaded with simple paths as shown below:

self.iconComboBox.addItem(QtGui.QIcon(':/images/bad.svg'), "Bad")
self.iconComboBox.addItem(QtGui.QIcon(':/images/heart.svg'), "Heart")
self.iconComboBox.addItem(QtGui.QIcon(':/images/trash.svg'), "Trash")

This of course works in development, but will not work when bundled as an application.

How can I make sure resources are loaded from the correct paths when using py2app?

fatuhoku
  • 4,815
  • 3
  • 30
  • 70
  • I found that when running the Python application `xyz` from the `xyz.app`, the current directory is `/path/to/xyz.app/Contents/Resources`. I'll try stick some resources into there... – fatuhoku Oct 08 '13 at 16:51
  • So I found that the resources were already being copied into the distribution directory. Using absolute paths to address the individual SVG's don't really seem to work. – fatuhoku Oct 08 '13 at 17:01
  • This is probably because of http://stackoverflow.com/questions/11534293/pyinstaller-wont-load-the-pyqts-images-to-the-gui So not really to do with py2app or PyInstaller! – fatuhoku Oct 09 '13 at 10:36

0 Answers0