alert

rumps.alert(title=None, message='', ok=None, cancel=None)

Generate a simple alert window.

Changed in version 0.2.0: Providing a cancel string will set the button text rather than only using text “Cancel”. title is no longer a required parameter.

Parameters:
  • title – the text positioned at the top of the window in larger font. If None, a default localized title is used. If not None or a string, will use the string representation of the object.
  • message – the text positioned below the title in smaller font. If not a string, will use the string representation of the object.
  • ok – the text for the “ok” button. Must be either a string or None. If None, a default localized button title will be used.
  • cancel – the text for the “cancel” button. If a string, the button will have that text. If cancel evaluates to True, will create a button with text “Cancel”. Otherwise, this button will not be created.
Returns:

a number representing the button pressed. The “ok” button is 1 and “cancel” is 0.