Hi All<br><br>Thanks for the replies, it's food for thought. I will be packaging my code with py2exe. If there's a snag in packaging them correctly then perhaps it's best for me to compile the ui. Unless of course someone has an idea as to what could be Sebastian's problem. Loading the ui file does seem a whole lot easier however, and having worked with wxpython and xrc, it wasn't much of a paradigm shift for me I suppose. But hey, we live, we learn. And again, thank you for the replies, if others still have more, please keep them coming. They are helpful.<br>
<br>Pard<br><br><div class="gmail_quote">On 28 September 2010 22:10, Sebastian Elsner <span dir="ltr"><<a href="mailto:sebastianelsner@freenet.de">sebastianelsner@freenet.de</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
Hmm interesting topic, I recently had to switch back from ui files to py files because I couldnt get py2exe to package the ui files correctly (Any help appreciated though)<br>
Secondly using ui files I loose the comfort of auto-completion with pydev and Eclipse, because pydev wouldnt know how to deal with the ui xml data. If there is anybody out there having advice on that, I'd gladly take it :)<br>
<br>
<br>
Am 28.09.2010 21:46, schrieb fpp:<div><div></div><div class="h5"><br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
On Tue, Sep 28, 2010 at 6:19 PM, pard<<a href="mailto:pardmeister@gmail.com" target="_blank">pardmeister@gmail.com</a>> wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
Hi<br>
I have found that some people use pyuic4 to compile their ui files and some<br>
load them dynamically using loadUI.<br>
Does anyone have the pro's and con's of each of these methods? What is the<br>
recommended PyQT way of doing this?<br>
</blockquote>
Thanks for starting the discussion, I've often wondered myself. I have<br>
no opinion one way or another, but since most seem to favour loadUI,<br>
I'll play the devil's advocate for pyuic4 :-)<br>
<br>
I can think of several reasons to prefer compiled ui files :<br>
<br>
1) if you're using eric4 as an IDE, it does everything for you, so why not ?<br>
<br>
2) on a reasonably recent PC, and for common UIs, the additional<br>
launch time, CPU& memory usage due to loadUI are probably not even<br>
measurable, compared to the Python, Qt and PyQt startup load.<br>
For extremely complex and widget-heavy UIs this might be less evident<br>
: parsing XML is not the most efficient thing in the world after all.<br>
And if we're running on mobile platforms with more limited<br>
power/CPU/RAM and slow Flash I/O, like Nokia's Symbian or Maemo<br>
smartphones, it could become quite perceptible.<br>
<br>
3) during the early design phases, it's sometimes handy to be able to<br>
manually modify a generated Python UI file, just to check out the<br>
effect of some minor change, without having to do it in Designer<br>
(especially if it involves sizers :-)<br>
<br>
4) if for some reason you wish or need to distribute only binaries, as<br>
sometimes happens, you can exclude the .ui source files and ship only<br>
the UI .pyc/pyo files.<br>
Dumb, yes, but not entirely impossible :-)<br>
_______________________________________________<br>
PyQt mailing list <a href="mailto:PyQt@riverbankcomputing.com" target="_blank">PyQt@riverbankcomputing.com</a><br>
<a href="http://www.riverbankcomputing.com/mailman/listinfo/pyqt" target="_blank">http://www.riverbankcomputing.com/mailman/listinfo/pyqt</a><br>
</blockquote>
<br>
_______________________________________________<br>
PyQt mailing list <a href="mailto:PyQt@riverbankcomputing.com" target="_blank">PyQt@riverbankcomputing.com</a><br>
<a href="http://www.riverbankcomputing.com/mailman/listinfo/pyqt" target="_blank">http://www.riverbankcomputing.com/mailman/listinfo/pyqt</a><br>
</div></div></blockquote></div><br>