def printme(str):
# "打印任何传入的字符串"
print(str)
return;
然后在鼠标单击时间中调用(或者是其他自己写的函数)
def on_selection_modified_async(self, view):
printme("123456789")
这样写的话会报错
Traceback (most recent call last):
File "/Applications/Sublime Text.app/Contents/MacOS/sublime_plugin.py", line 295, in on_selection_modified_async
callback.on_selection_modified_async(v)
File "/Users/songrao/Library/Application Support/Sublime Text 3/Packages/User/event.py", line 74, in on_selection_modified_async
printme("12346")
NameError: global name 'printme' is not defined
# "打印任何传入的字符串"
print(str)
return;
然后在鼠标单击时间中调用(或者是其他自己写的函数)
def on_selection_modified_async(self, view):
printme("123456789")
这样写的话会报错
Traceback (most recent call last):
File "/Applications/Sublime Text.app/Contents/MacOS/sublime_plugin.py", line 295, in on_selection_modified_async
callback.on_selection_modified_async(v)
File "/Users/songrao/Library/Application Support/Sublime Text 3/Packages/User/event.py", line 74, in on_selection_modified_async
printme("12346")
NameError: global name 'printme' is not defined