0

I need to create a simple message box on windows in python, and the message box should be customizable including updating messages/adding(removing) buttons etc.. In order to generate a fairly small-sized standalone executable in the end, I do not want to use big libraries such as wxpython. After a bit of searching, it looks like this is a good start:

import ctypes
MessageBox = ctypes.windll.user32.MessageBoxA
MessageBox(None, 'Hello', 'Window title', 0)

But it seems you cannot make buttons disappear in this kind of message boxes, and not able to update the messages as well.

So what choices do I have?

Shane
  • 4,875
  • 12
  • 49
  • 87
  • You want a message box with no button? (like ok, yes/no) ? – Nagaraj Tantri Jun 04 '15 at 09:18
  • Yeah, that's it and also the text in the msg box should be able to update as well. – Shane Jun 04 '15 at 09:20
  • Just give a glance on this [question](http://stackoverflow.com/questions/5388576/python-ctypes-win32-way-window-title-gets-truncted). You can actually create a window with no buttons and a message displayed. It would be hard to think a message box with no button. – Nagaraj Tantri Jun 04 '15 at 09:34

1 Answers1

0

The PyMsgBox module does exactly this: https://pymsgbox.readthedocs.io/en/latest/

Al Sweigart
  • 11,566
  • 10
  • 64
  • 92