• Login
Community
  • Login

Python Plugin Development

Scheduled Pinned Locked Moved Notepad++ & Plugin Development
6 Posts 2 Posters 951 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.
  • V
    VideoCarp
    last edited by Sep 6, 2020, 12:28 PM

    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.

    E 1 Reply Last reply Sep 6, 2020, 1:38 PM Reply Quote 1
    • E
      Ekopalypse @VideoCarp
      last edited by Sep 6, 2020, 1:38 PM

      @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.

      V 1 Reply Last reply Sep 6, 2020, 2:59 PM Reply Quote 1
      • V
        VideoCarp @Ekopalypse
        last edited by Sep 6, 2020, 2:59 PM

        @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
        • E
          Ekopalypse
          last edited by Ekopalypse Sep 6, 2020, 3:28 PM Sep 6, 2020, 3:26 PM

          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.

          V 1 Reply Last reply Sep 7, 2020, 8:02 AM Reply Quote 3
          • V
            VideoCarp @Ekopalypse
            last edited by Sep 7, 2020, 8:02 AM

            Ok, thanks.

            E 1 Reply Last reply Sep 7, 2020, 6:33 PM Reply Quote 0
            • E
              Ekopalypse @VideoCarp
              last edited by Sep 7, 2020, 6:33 PM

              @VideoCarp

              See here .

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