Python Forum
how include a python code in notpad++ plugin
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
how include a python code in notpad++ plugin
#1
hi
I wanted to draw a line in notpad++, so I searched Google for it.
in address: https://sourceforge.net/p/notepad-plus/d.../a0308d54/
has been written that
Quote:Or you could install the python script plug-in and use this bit of python
:
and said that the below code must be used:
#####
## Draw a dashed line
#####

# First we'll start an undo action, then Ctrl-Z will undo the actions of the whole script
editor.beginUndoAction()

dash='-'
width=80
print dash*width

## Finished.
# End the undo action, so Ctrl-Z will undo the above two actions
editor.endUndoAction()

# Turn the undo recorder back on.
editor.setUndoCollection(1)
I have Python script in notepad++ on my PC(it is in the plugin tab in the notepad++). how can I use the above code in notpad++?
thanks
Reply
#2
It's simpler to just use the Macro
Macro > Start Recording make a line 80 dash line Macro > Stop Recording
Macro > Save current recorded macro as eg line_80 then is finish,can use from Macro meny or assign a key to it.
akbarza likes this post
Reply
#3
You need to install the python plugin, then you create a shortcut.

https://www.delftstack.com/howto/python/...un-python/

I think the python plugin is meant more as a python development tool (like an IDE) than as a way to write notepad++ plugins.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  How to include one script into another? MorningWave 8 497 Mar-21-2024, 10:34 PM
Last Post: MorningWave
  Regex Include and Exclude patterns in Same Expression starzar 2 802 May-23-2023, 09:12 AM
Last Post: Gribouillis
  How to include input as part of variable name Mark17 4 2,524 Oct-01-2021, 06:45 PM
Last Post: Mark17
  ERROR: Cannot load plugin dbwest1 0 1,679 Sep-15-2020, 04:28 PM
Last Post: dbwest1
  Can I include text using artist? tetrisbot 0 1,440 Aug-13-2020, 08:13 PM
Last Post: tetrisbot
  How to include pandas with pyinstaller Rickus 1 10,664 Feb-19-2020, 08:01 PM
Last Post: snippsat
  How to include Variable in File Path penahuse 3 7,319 Jan-05-2020, 03:08 AM
Last Post: ichabod801
  Cannot open include file: 'ft2build.h' thracian 0 4,830 Nov-11-2019, 09:08 PM
Last Post: thracian
  I need a query to select the numbers that include 2 digits of 3 omidvakili 1 1,648 Sep-20-2019, 03:49 PM
Last Post: Yoriz
  plugin:xxx.py hasfailed to load 1204eray 1 2,137 Jun-26-2019, 09:23 PM
Last Post: micseydel

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020