Sublime Forum

Importing tkinter

#1

How can I get tkinter imported? It all works when I’m testing without it being loaded as a plugin.

[code]import sublime, sublime_plugin
from Tkinter import *
from tkColorChooser import askcolor

class ColorPicker(sublime_plugin.WindowCommand):
def run(self):
getBgColor(self)

def getBgColor(self):
(triple, hexstr) = askColor()
if hexstr:
try:
if self.window.active_view():
self.window.active_view().run_command(“insert_hex”, {“hex” : hexstr})
except ValueError:
pass

class InsertHex(sublime_plugin.TextCommand):
def run(self, edit, hex):
self.view.replace(edit, region, str(hex))[/code]

1 Like

#2

Doesn’t seem to be included in Sublime. Sqlite isn’t there either. Probably a way of trimming down the size of the download…

0 Likes

#3

Damn :frowning:

Any way we could get that in?

0 Likes

#4

Somebody must know?

0 Likes

#5

If it doesn’t have any other dependencies —which I don’t know—, copy the whole Tkinter package from any Python installation to Packages/Somewhere and make sure to add the target dir to sys.path in your plugin.

0 Likes