[PyQt] Finding the app folder under pyqtdeploy

David Cortesi davecortesi at gmail.com
Tue Aug 5 19:03:20 BST 2014


Looking ahead while coding an app that I expect will use pyqtdeploy. An app
bundled by pyinstaller, and I think also by cxfreeze, can know if it is
running bundled and discover the folder path of the app with code like the
following:

>  if hasattr(sys, 'frozen'): # running bundled
>      my_folder = os.path.dirname(sys.executable)
>  else: # run from command line or IDE
>      my_folder = os.path.dirname(__file__)

Looking at the pyqtdeploy doc I see no similar advice, except for this
sentence in [1],

> Every deployed application is able to import the pyqtdeploy module.
> This enables the application to determine if it is running as a
> deployed application...

It's not clear to me what the "am I bundled" test should consist of --
perhaps a try/except block around "import pyqtdeploy"?

Thanks for any advice,
  Dave Cortesi

[1]
http://pyqt.sourceforge.net/Docs/pyqtdeploy/pyqtdeploy_module.html#module-pyqtdeploy
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20140805/6df78ff6/attachment.html>


More information about the PyQt mailing list