Python script plugin alternative working with python 3?
-
Hi!
I just discovered the awesome python script plugin, and then… that it got stuck in python2.Is there a way to run a python (3.6) script that would do it’s work in the text of a specific tab?
For instance how can run a simple script that would apply the python function upper() to the text *. The way pythonscript was working with scientilla was awesome : editor.getText() do something with it and then editor.setText().It’s possible to add custom macro, and call them using shortcut (or launch them from the menu). But is it possible to do the same with a python3 script?
(I know it’s possible to run script using Pynpp, among other options. I’m looking for a way to run a script that would work on np++ tab)
*I know there is other solution for that: it’s an example. A typically 3.6 example would be to run this script :
answer = editor.getText()
editor.addText(print(f"did notepad++ made it? {answer}."))
on a tab containing this:
“yes, as always!” -
For those who also wonder, the work around is to use a python3.6 script that work with files (and not scintilla). Past the text that need to be processed in a tab, and run it from the tab of the script.
ps: This python 3.6 script below won’t work through the “python script” plugin:
Mytext = editor.getText()
editor.addText(print(f"my text is: {MyText}."))ps about the notepad forum:
1: the bottom of the text field doesn’t show in chrome.
2: a button to cancel an edit is also missing -
Hello,
Related:
You may find the LuaScript Plugin useful.
@dail has done a great work.
ps about the notepad forum:
1: the bottom of the text field doesn’t show in chrome.This frequently happens in Firefox too.
Best regards.
-
that’s interesting, I did not know about that langage. Thanks for the link!
-
You’re welcome.