[PyQt] Determining location of pyqtdeployed app at runtime
phil at riverbankcomputing.com
Fri Aug 1 22:19:32 BST 2014
On 01/08/2014 7:59 pm, Dave Gradwell wrote:
> I would like to determine the location from which my pyqtdeployed
> application was executed.
> I have read this:
> but this:
> gives me this:
> ... when it's pyqtdeployed. (Although it works fine when it's not
It should work (with v0.5, not earlier).
> This seems to work:
> but is that inadvisable for some reason? And would I be better off
> using the advised QFileInfo technique (maybe I have missed something)?
sys.executable will be correct (pyqtdeploy uses it internally). You can
use sys.executable when you know that the location you are after *will
not* be in the resource. You should use QFileInfo when the location
*might* be in the resource.
More information about the PyQt