Skip to content

A module to show message boxes in Windows-based Python applications.

License

Notifications You must be signed in to change notification settings

spmohara/Message-Box

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Message Box

Description

A module to show message boxes in Windows-based Python applications.

Usage

Parameters

title: str

  • The title shown on message box.
  • Default is 'My title'.

text: str

  • The text shown on message box.
  • Default is 'My text'.

button: str

  • The button(s) shown on message box.
  • Options include: 'OK' (default), 'OKCANCEL', 'ABORTRETRYIGNORE', 'YESNOCANCEL', 'YESNO', 'RETRYCANCEL', 'CANCELTRYCONTINUE', 'OKHELP'

icon: str

  • The icon shown on message box.
  • Options include: 'NOICON', 'ICONSTOP', 'ICONERROR', 'ICONHAND', 'ICONQUESTION', 'ICONEXCLAMATION', 'ICONWARNING', 'ICONINFORMATION' (default), 'ICONASTERISK'

Return

value: str

  • The button the user clicked on message box.
  • Values include: 'OK', 'CANCEL', 'ABORT', 'RETRY', 'IGNORE', 'YES', 'NO', 'TRYAGAIN', 'CONTINUE'

Examples

To show an information message box with OK and Cancel buttons:

import mbox

mbox.show(title='My Message Box', text='My message', button='OKCANCEL')

Info msg ok-cancel

To show an error message box with an OK button:

import mbox

mbox.show(title='My Message Box', text='My message', icon='ICONERROR')

Error msg ok

Some other possible options include:

No icon with Yes and No buttons:

No icon msg yes-no

Warning icon with OK and Help buttons:

Warning msg ok-help

Question icon with Abort, Retry, and Ignore buttons:

Question msg abort-retry-ignore

Dependencies

  • Python 3.x
  • Windows

License

Licensed under the MIT License

About

A module to show message boxes in Windows-based Python applications.

Topics

Resources

License

Stars

Watchers

Forks

Languages