On 23/06/2017 06:15, Damien Sykes-Lindley wrote:
Hi,
I’m relatively new to Python so please excuse me if this question has a
pretty obvious answer that I may have missed somewhere.
Since I work exclusively with Windows, the majority of my projects are
orientated towards GUI interfaces, meaning that the console often gets
in the way.
From what I understand, *.pyw files open in pythonw.exe, which is a
version of python.exe with no console.
What I also assumed was that since there is no console, unhandled
exceptions would be displayed in a message box or logged somewhere. I
seem to be wrong on both counts – no message is displayed and I can find
no logs. Is there a way to view such messages without resorting to
running them through the standard python.exe?

So the short answer is: nothing happens automatically to re-route exceptions etc. You have all the options you might expect: running with a console active (ie via python.exe or by adding a console); using sys.excepthook; using explicit logging of some sort; re-routing sys.stderr to a file [haven't tried that one but it should work].

But, yes, you have to do something. Nothing happens normally.

TJG
_______________________________________________
python-win32 mailing list
python-win32@python.org
https://mail.python.org/mailman/listinfo/python-win32

Reply via email to