Skip to content Skip to sidebar Skip to footer

Cx_freeze Issue With Relative Path On Mac

I'm having issues with cx_freeze relative path logic on mac. I'm using python 3.3 and pyqt5 and building an app portable windows - mac. The following simple script just loads an i

Solution 1:

a workaround is the following: instead of

pixmap = QtGui.QPixmap('testimage.jpeg')

place:

pixmap = QtGui.QPixmap(os.path.join(os.getcwd(),'image_insert_test-0.1.app/Contents/MacOS','testimage.jpeg')

this fishes the image path from the .app package but there has to be a more elegant way to do it.

Post a Comment for "Cx_freeze Issue With Relative Path On Mac"