On Wednesday 12 January 2011 05:14:45 Fars- mo wrote:
> Algis Kabaila  wrote:
> > On Sunday 02 January 2011 02:03:10 anatoly techtonik wrote:
> > > On Sat, Jan 1, 2011 at 8:12 AM, Algis Kabaila
(snip...)  
> 
> If the application quits with QApplication.exit(), then
> sys.exit() is necessary to pass the error code back to the
> system. Of course if you're absolutely sure that
> QApplication.exit() will never be called (at least not with
> a non-zero code), you can avoid sys.exit().
> 
> It's true that passing error codes to the system is less
> critical for a GUI application than for a command-line
> application, but if you do have an unexpected failure that
> forces the application to exit it's a very good idea to
> communicate that to the system so that the program that
> launched your application can act appropriately if needed.
> 
> So I wouldn't recommend dropping sys.exit().
> Cheers,
> Farsmo
> 
Thank you - I am almost convinced :).  Actually, I am not 
dropping anything, as I learned to use exec_() from my favourite 
book on PyQt.  AFAIK there only is *one* book worth mention on 
the topic.  It covers great many subjects in great detail, but 
never uses or AFAIR mentions sys.exit(exec_() ). 

So rather than dropping, I am considering adding sys.exit  :)

I thin that it is not as easy to understand as plain exec_() and 
that is why the author of that book chose to use the shorter 
form.  He is a great programmer and a good teacher, but he is 
only human, after all...

I greatly appreciate your reply.

Bye for now,

Al.
> _______________________________________________
> PySide mailing list
> [email protected]
> http://lists.openbossa.org/listinfo/pyside

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

Reply via email to