[PyQt] pyqtdeploy: data file access on IOS
Drembedded
drembedded at yahoo.com
Wed Feb 25 17:32:05 GMT 2015
Lloyd,
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:
http://pyqt.sourceforge.net/Docs/pyqtdeploy/tutorial.html
Note
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())
which returns:
['.Trashes',
'.file',
'.fseventsd',
'Applications',
'Developer',
'Library',
'System',
'bin',
'cores',
'dev',
'etc',
'private',
'sbin',
'tmp',
'usr',
'var']
Hopefully someone at Riverbank will chime in here and set me straight.
Cheers,
Michael
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
> http://www.riverbankcomputing.com/mailman/listinfo/pyqt
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20150225/5f282ee4/attachment.html>
More information about the PyQt
mailing list