简体   繁体   English

记事本++的Python插件

[英]Python Plugin for Notepad++

I installed PythonScript_1.0.8.0 for notepad++, saved my first script as Test.py and filled it as follows:我为 notepad++ 安装了 PythonScript_1.0.8.0,将我的第一个脚本保存为 Test.py 并按如下方式填充:

     Editor.selectAll() 
     Editor.paste() 
     notepad.runPluginCommand('NPPExport', 'Copy RTF to clipboard')

However when running, I got the following error:但是在运行时,我收到以下错误:

File "C:\\Users\\AA\\AppData\\Roaming\\Notepad++\\plugins\\Config\\PythonScript\\scripts\\Test.py", line 1, in文件“C:\\Users\\AA\\AppData\\Roaming\\Notepad++\\plugins\\Config\\PythonScript\\scripts\\Test.py”,第 1 行,在

Editor.selectAll() Editor.selectAll()

TypeError: unbound method Boost.Python.function object must be called with Editor instance as first argument (got nothing instead)类型错误:必须使用 Editor 实例作为第一个参数调用未绑定的方法 Boost.Python.function 对象(什么都没有)

Any Help?任何帮助?

You need to use editor instead of Editor .您需要使用editor而不是Editor Editor is the class and editor is the instance. Editor是类, editor是实例。 Example:例子:

editor.selectAll()

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM