Matteo Mattei

Hello, my name is Matteo Mattei and this is my personal website. I am computer engineer with a long experience in Linux system administration and web software development.

linkedin rss twitter google+ github facebook

Very simple graphical messagebox in Python useful for console applications with py2exe

When I have to develop background console applications in Python that have to be executed in Windows, I usually use py2exe and Inno Setup for creating installer. However the big issue is always how to report and show errors to the users. My preferred solution is to keep the application as a pure console application (no graphical), set the py2exe application as a window application and handle the errors with graphical messagebox.

And since the Tk library is included in the Python standard library, it is worth using it.

Lines 10 and 11 are needed to don’t show the main Tk window in background. Updated with support for both python 2.7 and python 3.x

comments powered by Disqus