Skip to content

Instantly share code, notes, and snippets.

@robmccormack
Created August 22, 2013 16:40
Show Gist options
  • Save robmccormack/6309703 to your computer and use it in GitHub Desktop.
Save robmccormack/6309703 to your computer and use it in GitHub Desktop.
tp_message_dialog.py
import sublime
import sublime_plugin
import os
# run this with at the Python console with:
# view.run_command("message_dialog")
class MessageDialogCommand(sublime_plugin.TextCommand):
print "User name: " + os.getlogin()
""" presents a dialog box, with only a OK button """
def run(self, edit):
# get the user's name
n= os.getlogin()
sublime.message_dialog("User " + n + " says: Hello World!" )
# posted to forums: sublime.question_box("hi")
# full list of os. http://www.pythonforbeginners.com/systems-programming/python-system-administration/
# The functions that the OS module provides allows you to interface with
# the underlying operating system that Python is running on – be that
# Windows, Mac or Linux.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment