Python Script don't work (newbie)

Anonymous
2012-06-29
2012-11-14
  • Anonymous - 2012-06-29

    Hello,

    Why I cant run the code saved it in 'filter.py':

    Editor.clearAll()
    

    When I press the script menu item it says:

    Traceback (most recent call last):
      File "C:\Users\david\AppData\Roaming\Notepad++\plugins\Config\PythonScript\scripts\filter.py", line 1, in <module>
        Editor.clearAll() 
    TypeError: unbound method Boost.Python.function object must be called with Editor instance as first argument (got nothing instead)
    

    Thank you all,

    David.

     
  • Anonymous - 2012-06-29

    I finallly autoresolved…

    I delete:

    C:\Program Files\Notepad++\python27.dll

    as I have python interpreter installed in

    c:\python27

    Reinit Notepad++ and all start to work.

     
  • Dave Brotherstone

    Actually that wasn't your problem - it doesn't matter if you remove the python27.dll if you've got Python 2.7 installed.  Personally I'd leave it there, as that's the tested version, but that's up to you.

    You just need to use

    editor.clearAll()
    

    instead of

    Editor.clearAll()
    

    Editor is the class, editor is the instance.  There's also editor1 and editor2 instances, which refer to the first and second views - editor always points to the current view.

    Cheers,
    Dave.

     

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks