On Sunday 02 January 2011 02:03:10 anatoly techtonik wrote:
> On Sat, Jan 1, 2011 at 8:12 AM, Algis Kabaila 
<[email protected]> wrote:
> > What is the reason for using sys.exit(main()) when simple
> > and clear main() would do just as well?
> 
> Return exit code to the system?
> --
> anatoly t.

I guess that may well be so, but is it really necessary?  My 
question comes from the fact that a simpler form is used in my 
favourite text book on PyQt, a book that arguably every aspiring 
PyQt or PySide programmer could be expected to read.

So why is sys.exit(app.exec_()) more attractive to so many 
people then simpler  app.exec_() ?  After all, it is not the 
failure that we are interested in, but a functioning program, 
no?  And how would sys.exit help(app.exec_()) help us in case of 
sys.exit() being invoked by a program bug?

Whilst I feel happy to follow my favourite book and author and 
use app.exec_() to invoke the event loop, I do not want to 
mislead other newbies if sys.exit(app.exec_())  is really 
superior. 

Is it?

Thanks a lot for partly answering this question..  I would like 
to see a deeper look into it.  Be assured that the quesion is 
not being asked frivolously.

Al aka OldAl.

-- 
Algis
http://akabaila.pcug.org.au
_______________________________________________
PySide mailing list
[email protected]
http://lists.openbossa.org/listinfo/pyside

Reply via email to