Skip to content

Instantly share code, notes, and snippets.

@zeffii
Forked from anonymous/good_thread
Created November 24, 2013 20:00
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 zeffii/7631693 to your computer and use it in GitHub Desktop.
Save zeffii/7631693 to your computer and use it in GitHub Desktop.
import sublime
import sublime_plugin
import subprocess
import threading
class OpenNotepadCommand(sublime_plugin.TextCommand):
def run(self, edit, filename=None):
th = NotepadThread(filename)
th.start()
class NotepadThread(threading.Thread):
def __init__(self, filename=None):
self.filename = filename
threading.Thread.__init__(self)
def run(self):
if self.filename is not None:
subprocess.call("notepad.exe %s" % self.filename)
else:
subprocess.call("notepad.exe")
@zeffii
Copy link
Author

zeffii commented Nov 24, 2013

threading

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment