Вы можете использовать импорт и однострочный код, например так:
import ctypes # An included library with Python install.
ctypes.windll.user32.MessageBoxW(0, "Your text", "Your title", 1)
Или определить функцию (Mbox) следующим образом:
import ctypes # An included library with Python install.
def Mbox(title, text, style):
return ctypes.windll.user32.MessageBoxW(0, text, title, style)
Mbox('Your title', 'Your text', 1)
Обратите внимание на следующие стили:
## Styles:
## 0 : OK
## 1 : OK | Cancel
## 2 : Abort | Retry | Ignore
## 3 : Yes | No | Cancel
## 4 : Yes | No
## 5 : Retry | No
## 6 : Cancel | Try Again | Continue
Веселись!
Примечание: отредактировано для использования MessageBoxW
вместо MessageBoxA