Community
    • Login

    Python Plugin Development

    Scheduled Pinned Locked Moved Notepad++ & Plugin Development
    6 Posts 2 Posters 946 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • VideoCarpV
      VideoCarp
      last edited by

      I’ve got some questions:

      • Is it possible to develop a plugin with Python?
      • Can I allow my plugin to highlight syntax of something that doesn’t currently have syntax highlighting by default?
      • Any resources?

      I can’t seem to find any resources for plugin development resources, if you know of any good resources for a beginner plugin developer, then please respond with one.

      Sorry if this is in the wrong category, or an answer is available (I can’t seem to find any), I’ve just joined this forum right now.

      EkopalypseE 1 Reply Last reply Reply Quote 1
      • EkopalypseE
        Ekopalypse @VideoCarp
        last edited by

        @VideoCarp

        Yes but no.
        Pure python, no, as a plugin needs to be a standard windows dll
        but together with cython and a little hack you can make this work.
        But there is an alternative which is called PythonScript plugin.
        This plugin allows you to use python to manipulate the scinitlla control.
        If you install this plugin you get example scripts which shows you
        what you can do with it.
        A few of them have a name like …Lexer.py, those are the ones you are looking for.

        VideoCarpV 1 Reply Last reply Reply Quote 1
        • VideoCarpV
          VideoCarp @Ekopalypse
          last edited by

          @Ekopalypse
          Oh ok thanks, so it is possible but not alone, I saw your specific tutorial from June 2019 one and a half hours ago, but are there are any sources or anything, or do I just read the normal plugin resources and transfer the way they’re written to how in Python (or Cython if needed)?

          1 Reply Last reply Reply Quote 0
          • EkopalypseE
            Ekopalypse
            last edited by Ekopalypse

            I do not know any documentation/tutorial about creating npp plugins with python.
            I would recommend reading https://npp-user-manual.org/docs/plugins/#how-to-develop-a-plugin
            and sources of existing plugins to understand their interaction.

            To create a plugin you need to create a dll.
            Afaik this can be done using either

            • cython
            • cffi and maybe
            • Nuitka (never tested by me)

            Using cython has the advantage that no additional modules are needed at runtime.
            If you are using CFFI on the other hand, it needs to be available at runtime.
            I tested both, more or less proof of concept only, and the resulting dll could be loaded and the coded scripts could be executed.
            I need to check my source - they should be still laying around somewhere.
            Let me see if I can bundle them to a basic package you can us as a starting point.

            VideoCarpV 1 Reply Last reply Reply Quote 3
            • VideoCarpV
              VideoCarp @Ekopalypse
              last edited by

              Ok, thanks.

              EkopalypseE 1 Reply Last reply Reply Quote 0
              • EkopalypseE
                Ekopalypse @VideoCarp
                last edited by

                @VideoCarp

                See here.

                1 Reply Last reply Reply Quote 2
                • First post
                  Last post
                The Community of users of the Notepad++ text editor.
                Powered by NodeBB | Contributors