[PyQt] PyQt Digest, Vol 162, Issue 4

Scott Harvey bundito at gmail.com
Thu Jan 4 18:33:46 GMT 2018


I hadn’t thought of compiling the generated .py file into a .pyc. Clever. I’ll try it the next time I reach a milestone worthy of an attempted single-file compile.

On Jan 4, 2018, 6:00 AM -0600, pyqt-request at riverbankcomputing.com, wrote:
> Send PyQt mailing list submissions to
> pyqt at riverbankcomputing.com
>
> To subscribe or unsubscribe via the World Wide Web, visit
> https://www.riverbankcomputing.com/mailman/listinfo/pyqt
> or, via email, send a message with subject or body 'help' to
> pyqt-request at riverbankcomputing.com
>
> You can reach the person managing the list at
> pyqt-owner at riverbankcomputing.com
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of PyQt digest..."
>
>
> Today's Topics:
>
> 1. Re: Massive inflation of .qrc files (Phil Thompson)
> 2. Re: Massive inflation of .qrc files (Giuseppe Corbelli)
> 3. Re: Massive inflation of .qrc files (Phil Thompson)
> 4. Re: Massive inflation of .qrc files (Pou Belle)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Wed, 3 Jan 2018 12:19:53 +0000
> From: Phil Thompson <phil at riverbankcomputing.com
> To: Giuseppe Corbelli <corbelligiuseppe at mesdan.it
> Cc: pyqt at riverbankcomputing.com
> Subject: Re: [PyQt] Massive inflation of .qrc files
> Message-ID:
> <A8E54CDE-A130-40D5-A8C8-F8E811E97838 at riverbankcomputing.com
> Content-Type: text/plain; charset=us-ascii
>
> On 3 Jan 2018, at 11:00 am, Giuseppe Corbelli <corbelligiuseppe at mesdan.it> wrote:
> >
> > On 01/03/2018 10:50 AM, Phil Thompson wrote:
> > > > > > I've tried putting "splash.hide()" as late in the execution order as possible, but it's still fast. I'm not going to cheat and use "sleep()" :-)
> > > > > >
> > > > > > Does anyone have any insight? I can reduce the quality of the image (since it's shown so briefly), but if the resulting resource file is so large, there's not much point. And 97Kb is hardly a large image.
> > > > > Using pyrcc is rarely a good idea.
> > > >
> > > > What would be your recommended approach to create a resource bundle?
> > > pyrcc is the only way to create a resource file for Python. The question is, why create a resource file at all?
> >
> > First thing that comes to mind is easier distribution in multiple formats (wheel, frozen...)
>
> I don't think it makes it any easier, see...
>
> http://pyqt.sourceforge.net/Docs/pyqtdeploy/pyrcc.html
>
> Phil
>
> ------------------------------
>
> Message: 2
> Date: Wed, 3 Jan 2018 15:31:25 +0100
> From: Giuseppe Corbelli <corbelligiuseppe at mesdan.it
> Cc: pyqt at riverbankcomputing.com
> Subject: Re: [PyQt] Massive inflation of .qrc files
> Message-ID: <7e523687-6596-0995-9258-5a757bdeb415 at mesdan.it
> Content-Type: text/plain; charset=utf-8; format=flowed
>
> On 01/03/2018 01:19 PM, Phil Thompson wrote:
> > > On 01/03/2018 10:50 AM, Phil Thompson wrote:
> > > > > > > I've tried putting "splash.hide()" as late in the execution order as possible, but it's still fast. I'm not going to cheat and use "sleep()" :-)
> > > > > > >
> > > > > > > Does anyone have any insight? I can reduce the quality of the image (since it's shown so briefly), but if the resulting resource file is so large, there's not much point. And 97Kb is hardly a large image.
> > > > > > Using pyrcc is rarely a good idea.
> > > > >
> > > > > What would be your recommended approach to create a resource bundle?
> > > > pyrcc is the only way to create a resource file for Python. The question is, why create a resource file at all?
> > >
> > > First thing that comes to mind is easier distribution in multiple formats (wheel, frozen...)
> >
> > I don't think it makes it any easier, see...
> >
> > http://pyqt.sourceforge.net/Docs/pyqtdeploy/pyrcc.html
>
> Sorry but I think I am missing something. Let's say I'm NOT using
> pyqtdeploy.
> I can deploy a wheel with the resource tree and use pkg_resources api.
> With pyinstaller I am forced to use resource-only eggs.
> Qt resources system + pyrcc is the only transparent solution I can think.
>
> --
> Giuseppe Corbelli
>
>
> ------------------------------
>
> Message: 3
> Date: Wed, 3 Jan 2018 17:10:50 +0000
> From: Phil Thompson <phil at riverbankcomputing.com
> To: Giuseppe Corbelli <corbelligiuseppe at mesdan.it
> Cc: pyqt at riverbankcomputing.com
> Subject: Re: [PyQt] Massive inflation of .qrc files
> Message-ID:
> <527C6C48-15A2-4526-AB8F-2E89C4BB5151 at riverbankcomputing.com
> Content-Type: text/plain; charset=us-ascii
>
> On 3 Jan 2018, at 2:31 pm, Giuseppe Corbelli <corbelligiuseppe at mesdan.it> wrote:
> >
> > On 01/03/2018 01:19 PM, Phil Thompson wrote:
> > > > On 01/03/2018 10:50 AM, Phil Thompson wrote:
> > > > > > > > I've tried putting "splash.hide()" as late in the execution order as possible, but it's still fast. I'm not going to cheat and use "sleep()" :-)
> > > > > > > >
> > > > > > > > Does anyone have any insight? I can reduce the quality of the image (since it's shown so briefly), but if the resulting resource file is so large, there's not much point. And 97Kb is hardly a large image.
> > > > > > > Using pyrcc is rarely a good idea.
> > > > > >
> > > > > > What would be your recommended approach to create a resource bundle?
> > > > > pyrcc is the only way to create a resource file for Python. The question is, why create a resource file at all?
> > > >
> > > > First thing that comes to mind is easier distribution in multiple formats (wheel, frozen...)
> > > I don't think it makes it any easier, see...
> > > http://pyqt.sourceforge.net/Docs/pyqtdeploy/pyrcc.html
> >
> > Sorry but I think I am missing something. Let's say I'm NOT using pyqtdeploy.
> > I can deploy a wheel with the resource tree and use pkg_resources api.
>
> As a wheel is expanded to the filesystem I don't see the need for any API to access a data file included in the wheel.
>
> > With pyinstaller I am forced to use resource-only eggs.
> > Qt resources system + pyrcc is the only transparent solution I can think.
>
> I've never used pyinstaller.
>
> Phil
>
> ------------------------------
>
> Message: 4
> Date: Thu, 4 Jan 2018 11:47:54 +0100
> From: Pou Belle <belepoub at gmail.com
> To: pyqt at riverbankcomputing.com
> Subject: Re: [PyQt] Massive inflation of .qrc files
> Message-ID:
> <CAH27=-8EXjDq=PF2-UHSZHvuFqBe+fHD+9AR4KgEwb4M+cg35A at mail.gmail.com
> Content-Type: text/plain; charset="utf-8"
>
> *Scott Harvey wrote*
> *> I've noticed that compiling a .qrc file into a qrc.py file results in a*
> *> massive increase in size, especially when containing an image.*
> *> *
> *> File Size*
> *> ------- -----------*
> *> splash.png 97244*
> *> splash.qrc 86*
> *> splash_qrc.py 402588*
>
>
> *Hello Scott,*
>
> *Compile your splash_qrc.py into a splash_qrc.pyc file, it will become very
> small again.*
>
> *Here is what I get on my current project :*
>
> *File Size*
> *Resources (png, jpg) : 124172*
> *resources.qrc : 429*
> *resources_rc.py : 373507*
> *resources_rc.pyc : 89712*
>
> *The only file that will really be loaded by python (pyc : 89712) is even
> smaller than the sum of the original files (124172).*
> *pyrcc is making my life a lot easier, I love it.*
>
> *Cheers.*
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: <https://www.riverbankcomputing.com/pipermail/pyqt/attachments/20180104/84141ba7/attachment-0001.html
>
> ------------------------------
>
> Subject: Digest Footer
>
> _______________________________________________
> PyQt mailing list
> PyQt at riverbankcomputing.com
> https://www.riverbankcomputing.com/mailman/listinfo/pyqt
>
> ------------------------------
>
> End of PyQt Digest, Vol 162, Issue 4
> ************************************
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.riverbankcomputing.com/pipermail/pyqt/attachments/20180104/59411182/attachment-0001.html>


More information about the PyQt mailing list