Skip to content

Instantly share code, notes, and snippets.

@nathanielatom
Last active October 11, 2017 20:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nathanielatom/422d024d9cab5c67668c60f96ded3590 to your computer and use it in GitHub Desktop.
Save nathanielatom/422d024d9cab5c67668c60f96ded3590 to your computer and use it in GitHub Desktop.
A (near) one-line cross-platform GUI-less message box
import webbrowser
import base64
def browser_msg(message):
webbrowser.open("data:{mime_type};base64,{data}".format(mime_type='text/html', data=base64.b64encode(message.encode()).decode()))
browser_msg("Hello world")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment