[PyQt] pyqtdeploy: data file access on IOS
drembedded at yahoo.com
Wed Feb 25 17:32:05 GMT 2015
Thank you for your response. Doing this results in the same directory
structure: ':/pyqtdeploy_ptest1' that I've hardcoded into the
sqlite3.connect() call: essentially the directory within the resource file.
Thats a great way to discover the full path into the resource file if
you're using pyqt calls but unfortunately any other methods that use
"standard Python file access functions such as sqlite3.connect() don't
seem to be able to access the pyqt's resource file system.
This limitation is noted in the tutorial:
Non-Python (i.e. data) files can also be included in the package. An
application typically accesses such files by using
theQFileInfo.absolutePath()function on the__file__attribute of a module
to obtain the name of the directory containing the data file. This
approach will also work with deployed applications so long as the file
is accessed using theQFileclass (rather than the standard Python file
access functions). However QML files require slightly different
treatment as their locations are specified using a URL.
So right now my only way around this issue is to copy my sqlite3
database file on to the IPad's file system which I can "see" using
standrd Pythn file access functions such as pprint.pprint(os.listdir())
Hopefully someone at Riverbank will chime in here and set me straight.
On 2/24/15 5:36 AM, lloyd konneker wrote:
> Did you try using __file__ per the documentation here:
> http://pyqt.sourceforge.net/Docs/pyqtdeploy/pyrcc.html ??
> PyQt mailing list PyQt at riverbankcomputing.com
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the PyQt