DrStrangeLove
DrStrangeLove

Reputation: 11557

Where is sublime.py?

Sublime Text2 text editor is extended via python scripts, using these modules:

import sublime, sublime_plugin

I've searched my computer and found sublime_plugin.py file. But where is sublime.py?

Upvotes: 2

Views: 1044

Answers (1)

Russ Clarke
Russ Clarke

Reputation: 17909

I believe that Sublime is provided dynamically when you call the plugin via the console.

Remember that an import doesn't have to be a physical .py file, it can be a library or an in-memory representation.

I found a decent reference to the confusions often related to Import, it's a little old now but I believe it's still relevant:

http://effbot.org/zone/import-confusion.htm

Edit: Just to confirm that, I've checked and the Python2.6 runtime is embedded inside the executable for Sublime, and the Sublime module is defined inside there.

Upvotes: 5

Related Questions