<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[No module named Npp]]></title><description><![CDATA[<p dir="auto">Hi everyone!</p>
<p dir="auto">I am trying to convert files in the directory into the UTF-8 format. This is the code:</p>
<pre><code>import os;
import sys;
import Npp;
from Npp import notepad

filePathSrc="somedirectoty " # Path to the folder with files to convert

for root, dirs, files in os.walk(filePathSrc):
    for fn in files:
        if fn[-4:] == '.txt':
             notepad.open(root + "\\" + fn)
             console.write(root + "\\" + fn + "\r\n")
             notepad.runMenuCommand("Encoding", "Convert to UTF-8 without BOM")
             notepad.save()
notepad.close()
</code></pre>
<p dir="auto">So when I try to run it, I get an error message “No module named Npp”. What do you think could be an issue? Thank you!</p>
]]></description><link>https://community.notepad-plus-plus.org/topic/17845/no-module-named-npp</link><generator>RSS for Node</generator><lastBuildDate>Sat, 11 Jul 2026 21:56:35 GMT</lastBuildDate><atom:link href="https://community.notepad-plus-plus.org/topic/17845.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 20 Jun 2019 17:49:35 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to No module named Npp on Fri, 21 Jun 2019 18:46:22 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/alan-kilborn" aria-label="Profile: Alan-Kilborn">@<bdi>Alan-Kilborn</bdi></a> yep :) well, thanks for your help!</p>
]]></description><link>https://community.notepad-plus-plus.org/post/44775</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/44775</guid><dc:creator><![CDATA[Alina Gubanova]]></dc:creator><pubDate>Fri, 21 Jun 2019 18:46:22 GMT</pubDate></item><item><title><![CDATA[Reply to No module named Npp on Fri, 21 Jun 2019 18:41:59 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/alina-gubanova" aria-label="Profile: Alina-Gubanova">@<bdi>Alina-Gubanova</bdi></a></p>
<p dir="auto">Of course, we could have never debugged THAT from here. :)</p>
]]></description><link>https://community.notepad-plus-plus.org/post/44774</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/44774</guid><dc:creator><![CDATA[Alan Kilborn]]></dc:creator><pubDate>Fri, 21 Jun 2019 18:41:59 GMT</pubDate></item><item><title><![CDATA[Reply to No module named Npp on Fri, 21 Jun 2019 18:35:42 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/alan-kilborn" aria-label="Profile: Alan-Kilborn">@<bdi>Alan-Kilborn</bdi></a> <a class="plugin-mentions-user plugin-mentions-a" href="/user/guy038" aria-label="Profile: guy038">@<bdi>guy038</bdi></a> Issue fixed. Changed <code>filePathSrc= "some directory"</code> to <code>filePathSrc= r"somedirectory"</code><br />
and everything worked fine.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/44773</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/44773</guid><dc:creator><![CDATA[Alina Gubanova]]></dc:creator><pubDate>Fri, 21 Jun 2019 18:35:42 GMT</pubDate></item><item><title><![CDATA[Reply to No module named Npp on Fri, 21 Jun 2019 17:18:14 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/guy038" aria-label="Profile: guy038">@<bdi>guy038</bdi></a> said:</p>
<blockquote>
<p dir="auto">I don’t really understand while you cannot get it straight. It should be practically obvious !</p>
</blockquote>
<p dir="auto">Maybe a tad harsh.  A reinstall of things is definitely not easy given the current state of things with the Pythonscript plugin.  But…to me it sounded like the OP had PS installed correctly from the beginning, just the approach to running a script was wrong.  That all being said, it is tough to determine currently what is going wrong.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/44772</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/44772</guid><dc:creator><![CDATA[Alan Kilborn]]></dc:creator><pubDate>Fri, 21 Jun 2019 17:18:14 GMT</pubDate></item><item><title><![CDATA[Reply to No module named Npp on Fri, 21 Jun 2019 16:05:07 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/guy038" aria-label="Profile: guy038">@<bdi>guy038</bdi></a> Once again, I appreciate your time commitment and input into this issue. I too find it frustrating that I cannot get such an easy thing to work, and as you can see I obviously do not have much experience working with N++. I assure you, from what I am looking at, I have performed all of the steps that you have described correctly, but I will make sure to reinstall the newer version of n++  in case something went wrong during installation.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/44771</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/44771</guid><dc:creator><![CDATA[Alina Gubanova]]></dc:creator><pubDate>Fri, 21 Jun 2019 16:05:07 GMT</pubDate></item><item><title><![CDATA[Reply to No module named Npp on Fri, 21 Jun 2019 19:07:31 GMT]]></title><description><![CDATA[<p dir="auto">Hello, <a class="plugin-mentions-user plugin-mentions-a" href="/user/alina-gubanova" aria-label="Profile: alina-gubanova">@<bdi>alina-gubanova</bdi></a>,</p>
<p dir="auto">I don’t really understand why you cannot get it <strong>straight</strong>. It should be practically <strong>obvious</strong> !</p>
<ul>
<li>
<p dir="auto">Create a folder, outside <strong><code>C\Program files...</code></strong>, on your configuration</p>
</li>
<li>
<p dir="auto">Install a recent <strong>portable</strong> N++ version by extracting the archive’s contents inside <strong>this</strong> folder</p>
</li>
<li>
<p dir="auto">Install a recent <strong>PythonScript</strong> release, by extracting the archive’s contents inside <strong>this</strong> folder</p>
</li>
<li>
<p dir="auto"><strong>Verify</strong> that the <strong>tree structure</strong>, of this <strong>new</strong> installation folder of N++, is like in my <strong>previous</strong> post</p>
</li>
<li>
<p dir="auto">Open Notepad++</p>
</li>
<li>
<p dir="auto">Select the option <strong><code>Plugins &gt; PythonScript &gt; New Script</code></strong></p>
</li>
<li>
<p dir="auto">Enter a <strong>name</strong> for your script, let’s say <strong><code>Alina</code></strong> and click on the <strong>Save</strong> button</p>
</li>
</ul>
<p dir="auto">=&gt; A <strong>new</strong> tab, <strong><code>Alina.py</code></strong> is, then, displayed</p>
<ul>
<li><strong>Paste</strong> the contents of your script, below, changing, of course, the value of the <strong><code>filePathSrc</code></strong> variable</li>
</ul>
<pre><code class="language-py">import os;
import sys;
import Npp;
from Npp import notepad

filePathSrc="X:\\xxxxxxxxxxxxt" # Path to the folder with files to convert

for root, dirs, files in os.walk(filePathSrc):
    for fn in files:
        if fn[-4:] == '.txt':
             notepad.open(root + "\\" + fn)
             console.write(root + "\\" + fn + "\r\n")
             notepad.runMenuCommand("Encoding", "Convert to UTF-8")
             notepad.save()
notepad.close()
</code></pre>
<ul>
<li>
<p dir="auto"><strong>Save</strong> the <strong><code>Alina.py</code></strong> Python file</p>
</li>
<li>
<p dir="auto"><strong>Close</strong> and <strong>restart</strong> Notepad++ ( <em>IMPORTANT</em> as your script will be found, inside the <strong>Python files</strong> list)</p>
</li>
<li>
<p dir="auto">Choose the option <strong><code>Plugins &gt; PythonScript &gt; Show Console</code></strong>, just to visualize possible <strong>errors</strong></p>
</li>
<li>
<p dir="auto">Then, <strong>run</strong> your script, by selecting the option <strong><code>Plugins &gt; PythonScript &gt; Scripts &gt; Alina</code></strong></p>
</li>
</ul>
<p dir="auto">=&gt; The <strong>absolute</strong> paths of all the files of your <strong>folder</strong> should be displayed on the <strong>Python</strong> console</p>
<p dir="auto">Done ! Here we are ;-))</p>
<p dir="auto">Best Regards,</p>
<p dir="auto">guy038</p>
]]></description><link>https://community.notepad-plus-plus.org/post/44770</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/44770</guid><dc:creator><![CDATA[guy038]]></dc:creator><pubDate>Fri, 21 Jun 2019 19:07:31 GMT</pubDate></item><item><title><![CDATA[Reply to No module named Npp on Fri, 21 Jun 2019 14:43:43 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/alan-kilborn" aria-label="Profile: Alan-Kilborn">@<bdi>Alan-Kilborn</bdi></a> Okay, will do! Thank you again!</p>
]]></description><link>https://community.notepad-plus-plus.org/post/44768</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/44768</guid><dc:creator><![CDATA[Alina Gubanova]]></dc:creator><pubDate>Fri, 21 Jun 2019 14:43:43 GMT</pubDate></item><item><title><![CDATA[Reply to No module named Npp on Fri, 21 Jun 2019 14:41:57 GMT]]></title><description><![CDATA[<p dir="auto">Well, from the error message I’d assume that you put <code>console.write()</code> directly in your code.  What I mean was to put something like <code>console.write('got here!')</code> at a strategic place or putting a variable name inside the parens, or…just in general some debugging techniques that one might do when programming Python without an IDE.</p>
<p dir="auto">Like <a class="plugin-mentions-user plugin-mentions-a" href="/user/guy038" aria-label="Profile: guy038">@<bdi>guy038</bdi></a>, when I run your original script on some test files, it seems to do what you intend.</p>
<p dir="auto">I’m assuming you got this working script from a coworker as you hinted before. Perhaps asking him/her for help getting it going is a better path than us trying to help you from afar.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/44767</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/44767</guid><dc:creator><![CDATA[Alan Kilborn]]></dc:creator><pubDate>Fri, 21 Jun 2019 14:41:57 GMT</pubDate></item><item><title><![CDATA[Reply to No module named Npp on Fri, 21 Jun 2019 14:19:47 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/alan-kilborn" aria-label="Profile: Alan-Kilborn">@<bdi>Alan-Kilborn</bdi></a> Now I just get <code>Traceback (most recent call last):   File "C:\...\Notepad++\plugins\PythonScript\scripts\convertutf8.py", line 14, in &lt;module&gt;     console.write() Boost.Python.ArgumentError: Python argument types in     Console.write(Console) did not match C++ signature:     write(class NppPythonScript::PythonConsole {lvalue}, class boost::python::api::object)</code>  when I added some console.write()</p>
]]></description><link>https://community.notepad-plus-plus.org/post/44766</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/44766</guid><dc:creator><![CDATA[Alina Gubanova]]></dc:creator><pubDate>Fri, 21 Jun 2019 14:19:47 GMT</pubDate></item><item><title><![CDATA[Reply to No module named Npp on Fri, 21 Jun 2019 14:09:02 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/alina-gubanova" aria-label="Profile: Alina-Gubanova">@<bdi>Alina-Gubanova</bdi></a></p>
<p dir="auto">I think you are on the right track for running your script now.</p>
<p dir="auto">I presume you are trying to run the original script you posted?  If that’s the case, I don’t see any reason why a new1 window would be opened. Perhaps you should add some more console.write() statements to the script to attempt to track control flow?</p>
]]></description><link>https://community.notepad-plus-plus.org/post/44764</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/44764</guid><dc:creator><![CDATA[Alan Kilborn]]></dc:creator><pubDate>Fri, 21 Jun 2019 14:09:02 GMT</pubDate></item><item><title><![CDATA[Reply to No module named Npp on Fri, 21 Jun 2019 14:02:45 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/alan-kilborn" aria-label="Profile: Alan-Kilborn">@<bdi>Alan-Kilborn</bdi></a> Just to be very clear: I save the script that I need and then run it directly from the Pythonscript menu:<br />
Plugins -&gt; Python Scropt -&gt; Scripts -&gt; nameofmyscript.<br />
Tried it just now, it seems like nothing is happening. It just opens a new window new1. Console is empty as well.<br />
What step am I missing?</p>
]]></description><link>https://community.notepad-plus-plus.org/post/44763</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/44763</guid><dc:creator><![CDATA[Alina Gubanova]]></dc:creator><pubDate>Fri, 21 Jun 2019 14:02:45 GMT</pubDate></item><item><title><![CDATA[Reply to No module named Npp on Fri, 21 Jun 2019 00:31:47 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/alina-gubanova" aria-label="Profile: Alina-Gubanova">@<bdi>Alina-Gubanova</bdi></a> said:</p>
<blockquote>
<p dir="auto">I apologize for the confusion. Followed the steps that were suggested by a coworker…</p>
</blockquote>
<p dir="auto">No apology needed – it slowed you down in getting a solution you needed, is all.  Didn’t hurt me/us a bit. :)</p>
<p dir="auto">Never trust those shifty coworkers!! ;)</p>
<p dir="auto">Write back if you need more help.  If you don’t need more help, just upvote the postings here that helped you most.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/44749</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/44749</guid><dc:creator><![CDATA[Alan Kilborn]]></dc:creator><pubDate>Fri, 21 Jun 2019 00:31:47 GMT</pubDate></item><item><title><![CDATA[Reply to No module named Npp on Fri, 21 Jun 2019 00:26:12 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/dail" aria-label="Profile: dail">@<bdi>dail</bdi></a> said:</p>
<blockquote>
<p dir="auto">My suspicion was correct</p>
</blockquote>
<p dir="auto">Yes, except <em>technically</em> the OP <em>was</em> launching it from <em>within</em> Notepad++.  But…there are degrees of within, and when you are wanting to do operations with Python tight to the Scintilla and Notepad++ cores (the original script used the <code>notepad</code> object), you have to be <em><strong>REALLY</strong></em> <em>within</em>.  :)</p>
<ul>
<li>
<p dir="auto"><em><strong>Run</strong></em> menu : sorta within, but mostly not because it is just telling Notepad++ to launch an external process</p>
</li>
<li>
<p dir="auto"><em><strong>Pythonscript</strong></em> menu : really within, because it is using the Python interpreter part of the plugin (and can access the <code>editor</code> (Scintilla) and <code>notepad</code> (N++) objects.</p>
</li>
</ul>
<p dir="auto">And <a class="plugin-mentions-user plugin-mentions-a" href="/user/dail" aria-label="Profile: dail">@<bdi>dail</bdi></a>, I know you know all this … I write it for the edification of other readers. :)</p>
]]></description><link>https://community.notepad-plus-plus.org/post/44748</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/44748</guid><dc:creator><![CDATA[Alan Kilborn]]></dc:creator><pubDate>Fri, 21 Jun 2019 00:26:12 GMT</pubDate></item><item><title><![CDATA[Reply to No module named Npp on Thu, 20 Jun 2019 21:58:20 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/alan-kilborn" aria-label="Profile: Alan-Kilborn">@<bdi>Alan-Kilborn</bdi></a> said:</p>
<blockquote>
<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/alina-gubanova" aria-label="Profile: Alina-Gubanova">@<bdi>Alina-Gubanova</bdi></a> said:</p>
<blockquote>
<p dir="auto">So these are my steps</p>
</blockquote>
<p dir="auto">You could have said that in the beginning and saved some time.  You can’t run a Pythonscript that way.  It isn’t going to know about the special “notepad” objects. You have to run it from the Pythonscript menu, as I said earlier.</p>
</blockquote>
<p dir="auto">My suspicion was correct :)</p>
]]></description><link>https://community.notepad-plus-plus.org/post/44744</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/44744</guid><dc:creator><![CDATA[dail]]></dc:creator><pubDate>Thu, 20 Jun 2019 21:58:20 GMT</pubDate></item><item><title><![CDATA[Reply to No module named Npp on Thu, 20 Jun 2019 21:17:12 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/guy038" aria-label="Profile: guy038">@<bdi>guy038</bdi></a> thank you so much for putting time into this and offering some useful advice! I’ll make sure to follow the steps and let you know!</p>
]]></description><link>https://community.notepad-plus-plus.org/post/44743</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/44743</guid><dc:creator><![CDATA[Alina Gubanova]]></dc:creator><pubDate>Thu, 20 Jun 2019 21:17:12 GMT</pubDate></item><item><title><![CDATA[Reply to No module named Npp on Thu, 20 Jun 2019 21:15:57 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/alan-kilborn" aria-label="Profile: Alan-Kilborn">@<bdi>Alan-Kilborn</bdi></a> I apologize for the confusion. Followed the steps that were suggested by a coworker, so wasn’t aware of the issue. I’ll try running it that way. Thank you for your time</p>
]]></description><link>https://community.notepad-plus-plus.org/post/44742</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/44742</guid><dc:creator><![CDATA[Alina Gubanova]]></dc:creator><pubDate>Thu, 20 Jun 2019 21:15:57 GMT</pubDate></item><item><title><![CDATA[Reply to No module named Npp on Thu, 20 Jun 2019 21:10:15 GMT]]></title><description><![CDATA[<p dir="auto">Hi, <a class="plugin-mentions-user plugin-mentions-a" href="/user/alina-gubanova" aria-label="Profile: alina-gubanova">@<bdi>alina-gubanova</bdi></a>,</p>
<p dir="auto">Before, describing the <strong>tree structure</strong> of my <strong><code>D:\@à\763</code></strong> folder, note <strong>two</strong> points :</p>
<ul>
<li>
<p dir="auto">The <strong>install</strong> folder of a <strong>portable</strong> N++ version must be <strong>different</strong> from, either, <strong><code>C\Program files</code></strong> and <strong><code>C\Program files (x86)</code></strong></p>
</li>
<li>
<p dir="auto">Any <strong>local</strong> installation of Notepad++ needs the <strong>zero-length</strong> file, <strong><code>doLocalConf.xml</code></strong>, along with the executable <strong><code>notepad++.exe</code></strong></p>
</li>
</ul>
<p dir="auto">This file, installed by <strong>default</strong>, assures you that any file <strong>created</strong> and/or <strong>handled</strong> by Notepad++, will be located <strong>inside</strong> the <strong>installation</strong> folder ;-))</p>
<hr />
<p dir="auto">Depending of your <strong>system</strong>, follow one of these links, below, to download the last <strong>portable</strong> N++ <strong><code>v7.7.1</code></strong></p>
<p dir="auto"><a href="https://notepad-plus-plus.org/repository/7.x/7.7.1/npp.7.7.1.bin.zip" rel="nofollow ugc">https://notepad-plus-plus.org/repository/7.x/7.7.1/npp.7.7.1.bin.zip</a></p>
<p dir="auto"><a href="https://notepad-plus-plus.org/repository/7.x/7.7.1/npp.7.7.1.bin.x64.zip" rel="nofollow ugc">https://notepad-plus-plus.org/repository/7.x/7.7.1/npp.7.7.1.bin.x64.zip</a></p>
<p dir="auto">Just create any <strong>folder</strong> in your system and <strong>extract</strong> the contents of the archive in <strong>this</strong> folder !</p>
<p dir="auto">On the other hand, I’m using the PythonScript <strong><code>v1.3.0.0</code></strong> ( <strong>PythonScript_Full_1.3.0.0.zip</strong> ) but you’ll find the <strong>latest</strong> release <strong><code>v1.4.0.0 </code></strong>, below :</p>
<p dir="auto"><a href="https://github.com/bruderstein/PythonScript/releases" rel="nofollow ugc">https://github.com/bruderstein/PythonScript/releases</a></p>
<p dir="auto">Note that, from N++ version <strong><code>v7.6</code></strong> and above, there’s a <strong>new</strong> organization of plugins, in the <strong><code>Plugins</code></strong> folder. From now on, any plugin, let’s say <strong><code>myFirstPlugin.dll</code></strong>, must be moved inside a <strong>folder</strong> named the <strong>same</strong> way, so <strong>myFirstPlugin</strong> !</p>
<hr />
<p dir="auto">OK, as promised, here is the <strong>tree</strong> structure of my <strong><code>D:\@@\763</code></strong> folder :</p>
<pre><code class="language-diff">D:\@@\763
	\
	|
	|-- autoCompletion (folder)
	|                \
	|                |-- ".xml" files
	|
	|
	|-- localization (folder)
	|              \
	|              |-- ".xml" files
	|
	|
	|-- plugins (folder)
	|         \
	|         |
	|         |-- Config (folder)
	|         |        \
	|         |        |
	|         |        |-- Hunspell (folder)
	|         |        |          \
	|         |        |          |-- en_US.aff
	|         |        |          |
	|         |        |          |-- en_US.dic
	|         |        |
	|         |        |
	|         |        |-- PythonScript (folder)
	|         |        |              \
	|         |        |              |-- scripts (folder)
	|         |        |                        \
	|         |        |                         |-- Alina.py ( YOUR script )
	|         |        |
	|         |        |
	|         |        |-- ".ini" files
	|         |        |
	|         |        |
	|         |        |-- nppPluginList.dll
	|         |
	|         |
	|         |-- doc (folder)
	|         |     \
	|         |      |-- PythonScript(folder)
	|         |                     \
	|         |                     |-- _sources (folder)
	|         |                     |
	|         |                     |-- _static  (folder)
	|         |                     |
	|         |                     |-- ".html" files and Miscellaneous files
	|         |
	|         |
	|         |-- DSpellCheck (folder)
	|         |             \
	|         |             |-- DSpellCheck.dll
	|         |
	|         |
	|         |-- mineTools (folder)
	|         |           \
	|         |           |-- mineTools.dll
	|         |
	|         |
	|         |-- NppConverter (folder)
	|         |              \
	|         |              |-- NppConverter.dll
	|         |
	|         |
	|         |-- NppExport (folder)
	|         |           \
	|         |           |-- NppExport.dll
	|         |
	|         |
	|         |-- PythonScript (folder)
	|                        \
	|                        |-- lib (folder)
	|                        |     \
	|                        |      |-- Sub-folders
	|                        |      |
	|                        |      |-- ".py" files
	|                        |
	|                        |
	|                        |-- scripts (folder)
	|                        |         \
	|                        |         |-- Samples (folder)
	|                        |         |         \
	|                        |         |         |-- ".py" scripts
	|                        |         |
	|                        |         |-- startup.py
	|                        |
	|                        |
	|                        |-- PythonScript.dll  ( Version 1.3.0.0 )
	|
	|
	|-- Test
	|      \
	|      |-- File_1.txt
	|      |
	|      |-- File_2.txt
	|
	|
	|
	|-- themes (folder)
	|        \
	|        |-- ".xml" files
	|
	|
	|-- updater (folder)
	|         \
	|         |-- GUP.exe
	|         |
	|         |-- gup.xml
	|         |
	|         |-- libcurl.dll
	|
	|
	|-- doLocalConf.xml
	|
	|
	|-- Notepad++.exe  ( Version 7.6.3 )
	|
	|
	|-- python27.dll
	|
	|
	|-- SciLexer.dll
	|
	|
	|-- Some ".txt" files
	|
	|
	|-- Some ".xml" CONFIGURATION files
</code></pre>
<p dir="auto">I Just hope that you’ll get some part <strong>useful</strong> !</p>
<p dir="auto">Cheers,</p>
<p dir="auto">guy038</p>
]]></description><link>https://community.notepad-plus-plus.org/post/44740</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/44740</guid><dc:creator><![CDATA[guy038]]></dc:creator><pubDate>Thu, 20 Jun 2019 21:10:15 GMT</pubDate></item><item><title><![CDATA[Reply to No module named Npp on Thu, 20 Jun 2019 20:29:23 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/alina-gubanova" aria-label="Profile: Alina-Gubanova">@<bdi>Alina-Gubanova</bdi></a> said:</p>
<blockquote>
<p dir="auto">So these are my steps</p>
</blockquote>
<p dir="auto">You could have said that in the beginning and saved some time.  You can’t run a Pythonscript that way.  It isn’t going to know about the special “notepad” objects. You have to run it from the Pythonscript menu, as I said earlier.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/44731</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/44731</guid><dc:creator><![CDATA[Alan Kilborn]]></dc:creator><pubDate>Thu, 20 Jun 2019 20:29:23 GMT</pubDate></item><item><title><![CDATA[Reply to No module named Npp on Thu, 20 Jun 2019 19:58:59 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/guy038" aria-label="Profile: guy038">@<bdi>guy038</bdi></a> thank you so much for putting your time in such a detailed explanation. I should definitely update my N++ version :)<br />
I followed every step of your explanation, and I still get an error. When you Run the script what is the directory that you use?</p>
<p dir="auto">I suspect mine could be wrong. Is it <code>C:…\Python2.7\Lib\idlelib\idle.py “$(FULL_CURRENT_PATH)” </code>?</p>
]]></description><link>https://community.notepad-plus-plus.org/post/44730</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/44730</guid><dc:creator><![CDATA[Alina Gubanova]]></dc:creator><pubDate>Thu, 20 Jun 2019 19:58:59 GMT</pubDate></item><item><title><![CDATA[Reply to No module named Npp on Thu, 20 Jun 2019 19:56:02 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/dail" aria-label="Profile: dail">@<bdi>dail</bdi></a> yes.<br />
So these are my steps:<br />
Run -&gt; Python (where I saved C:.…\Python2.7\Lib\idlelib\idle.py “$(FULL_CURRENT_PATH)”) -&gt; IDLE opens up in a new window -&gt; press F5 -&gt; <code>Traceback (most recent call last):   File "C:\Users\agubanova\Notepad++\plugins\PythonScript\scripts\new script.py", line 3, in &lt;module&gt;     import Npp; ImportError: No module named Npp </code></p>
]]></description><link>https://community.notepad-plus-plus.org/post/44729</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/44729</guid><dc:creator><![CDATA[Alina Gubanova]]></dc:creator><pubDate>Thu, 20 Jun 2019 19:56:02 GMT</pubDate></item><item><title><![CDATA[Reply to No module named Npp on Thu, 20 Jun 2019 19:52:09 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/alina-gubanova" aria-label="Profile: Alina-Gubanova">@<bdi>Alina-Gubanova</bdi></a> How are you launching the script? Inside of Notepad++?</p>
]]></description><link>https://community.notepad-plus-plus.org/post/44728</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/44728</guid><dc:creator><![CDATA[dail]]></dc:creator><pubDate>Thu, 20 Jun 2019 19:52:09 GMT</pubDate></item><item><title><![CDATA[Reply to No module named Npp on Thu, 20 Jun 2019 19:51:48 GMT]]></title><description><![CDATA[<p dir="auto">Hello, <a class="plugin-mentions-user plugin-mentions-a" href="/user/alina-gubanova" aria-label="Profile: alina-gubanova">@<bdi>alina-gubanova</bdi></a>, <a class="plugin-mentions-user plugin-mentions-a" href="/user/alan-kilborn" aria-label="Profile: alan-kilborn">@<bdi>alan-kilborn</bdi></a>, and <strong>All</strong>,</p>
<p dir="auto">Among my numerous <strong>portable</strong> versions of Notepad++, installed on my laptop, I considered the <strong>most recent</strong> one, where the <strong>Python</strong> script was installed =&gt; I tested the <strong>Alina</strong>’s script with Notepad++ <strong><code>v7.6.3</code></strong> !</p>
<p dir="auto">As this version is located in <strong><code>D:\@@\763\...</code></strong> :</p>
<ul>
<li>
<p dir="auto">First, I created a folder named <strong><code>D:\@@\763\Test</code></strong></p>
</li>
<li>
<p dir="auto">Then I created two <strong>ANSI</strong> files,  in folder <strong><code>Test</code></strong></p>
</li>
<li>
<p dir="auto">I opened N++ <strong><code>v7.6.3</code></strong> and the Python <strong>console</strong></p>
</li>
<li>
<p dir="auto">I used the <strong>Python</strong> script, below which worked as <strong>expected</strong> : The <strong>two</strong> files, in the <strong><code>Test</code></strong> folder, have been <strong>saved</strong> with the new <strong><code>UTf-8</code></strong> encoding, without any trouble !</p>
</li>
</ul>
<pre><code class="language-py">import os;
import sys;
import Npp;
from Npp import notepad

filePathSrc="D:\\@@\\763\\Test" # Path to the folder with files to convert

for root, dirs, files in os.walk(filePathSrc):
    for fn in files:
        if fn[-4:] == '.txt':
             notepad.open(root + "\\" + fn)
             console.write(root + "\\" + fn + "\r\n")
             notepad.runMenuCommand("Encoding", "Convert to UTF-8")
             notepad.save()
notepad.close()
</code></pre>
<p dir="auto">and <strong>after</strong> executing the script, it wrote, on <strong>console</strong> :</p>
<pre><code class="language-diff">Python 2.7.15 (v2.7.15:ca079a3ea3, Apr 30 2018, 16:22:17) [MSC v.1500 32 bit (Intel)]
Initialisation took 125ms
Ready.
D:\@@\763\Test\File_1.txt
D:\@@\763\Test\File_2.txt
</code></pre>
<hr />
<p dir="auto">As you can see, in the script :</p>
<ul>
<li>
<p dir="auto">Of course, I just changed the <strong>value</strong> of the variable <strong>filePathSrc</strong></p>
</li>
<li>
<p dir="auto">I also changed the line :</p>
</li>
</ul>
<pre><code class="language-py">         notepad.runMenuCommand("Encoding", "Convert to UTF-8 without BOM")
</code></pre>
<p dir="auto">by the line :</p>
<pre><code class="language-py">         notepad.runMenuCommand("Encoding", "Convert to UTF-8")
</code></pre>
<p dir="auto">This detail supposes that <a class="plugin-mentions-user plugin-mentions-a" href="/user/alina-gubanova" aria-label="Profile: alina-gubanova">@<bdi>alina-gubanova</bdi></a> is using, a <strong>very old</strong> version of N++ ;-))</p>
<p dir="auto">Best Regards,</p>
<p dir="auto">guy038</p>
]]></description><link>https://community.notepad-plus-plus.org/post/44727</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/44727</guid><dc:creator><![CDATA[guy038]]></dc:creator><pubDate>Thu, 20 Jun 2019 19:51:48 GMT</pubDate></item><item><title><![CDATA[Reply to No module named Npp on Thu, 20 Jun 2019 19:40:11 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/alan-kilborn" aria-label="Profile: Alan-Kilborn">@<bdi>Alan-Kilborn</bdi></a> thanks for your help anyway!</p>
]]></description><link>https://community.notepad-plus-plus.org/post/44726</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/44726</guid><dc:creator><![CDATA[Alina Gubanova]]></dc:creator><pubDate>Thu, 20 Jun 2019 19:40:11 GMT</pubDate></item><item><title><![CDATA[Reply to No module named Npp on Thu, 20 Jun 2019 19:15:07 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/alina-gubanova" aria-label="Profile: Alina-Gubanova">@<bdi>Alina-Gubanova</bdi></a></p>
<p dir="auto">You are in an area where I don’t think I can provide further help, but <a class="plugin-mentions-user plugin-mentions-a" href="/user/dail" aria-label="Profile: dail">@<bdi>dail</bdi></a> is typing, so… :)</p>
]]></description><link>https://community.notepad-plus-plus.org/post/44725</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/44725</guid><dc:creator><![CDATA[Alan Kilborn]]></dc:creator><pubDate>Thu, 20 Jun 2019 19:15:07 GMT</pubDate></item></channel></rss>