Re: PyQt Digest, Vol 162, Issue 4

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Re: PyQt Digest, Vol 162, Issue 4

Scott Harvey
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, [hidden email], wrote:
Send PyQt mailing list submissions to
[hidden email]

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
[hidden email]

You can reach the person managing the list at
[hidden email]

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 <[hidden email]
To: Giuseppe Corbelli <[hidden email]
Cc: [hidden email]
Subject: Re: [PyQt] Massive inflation of .qrc files
Message-ID:
<[hidden email]
Content-Type: text/plain; charset=us-ascii

On 3 Jan 2018, at 11:00 am, Giuseppe Corbelli <[hidden email]> 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 <[hidden email]
Cc: [hidden email]
Subject: Re: [PyQt] Massive inflation of .qrc files
Message-ID: <[hidden email]
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 <[hidden email]
To: Giuseppe Corbelli <[hidden email]
Cc: [hidden email]
Subject: Re: [PyQt] Massive inflation of .qrc files
Message-ID:
<[hidden email]
Content-Type: text/plain; charset=us-ascii

On 3 Jan 2018, at 2:31 pm, Giuseppe Corbelli <[hidden email]> 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 <[hidden email]
To: [hidden email]
Subject: Re: [PyQt] Massive inflation of .qrc files
Message-ID:
<CAH27=-8EXjDq=[hidden email]
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
[hidden email]
https://www.riverbankcomputing.com/mailman/listinfo/pyqt

------------------------------

End of PyQt Digest, Vol 162, Issue 4
************************************

_______________________________________________
PyQt mailing list    [hidden email]
https://www.riverbankcomputing.com/mailman/listinfo/pyqt
Reply | Threaded
Open this post in threaded view
|

Re: PyQt Digest, Vol 162, Issue 4

Hans-Peter Jansen-2
Hi Scott,

this mailing list is rather low volume, that it doesn't make much sense to use
the digest mode here, but you have your reasons, I guess.

Anyway, please edit the subject line and cut down the text to (*at least*) the
part, you're responding to. With that, you're doing everybody else in the
audience a big favor (we all got those messages already..).

Thanks,
Pete

On Donnerstag, 4. Januar 2018 12:33:46 Scott Harvey wrote:

> 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, [hidden email], wrote:
> > Send PyQt mailing list submissions to
> > [hidden email]
> >
> > 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
> > [hidden email]
> >
> > You can reach the person managing the list at
> > [hidden email]
> >
> > 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)
> >

_______________________________________________
PyQt mailing list    [hidden email]
https://www.riverbankcomputing.com/mailman/listinfo/pyqt