<?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[Tabs in python]]></title><description><![CDATA[<p dir="auto">Hello, I have some problems with python files, when I try to use tabs it will make normal spaces the same size as tabs. The problem is that is ruining the code and I cannot run it. Any solution?</p>
]]></description><link>https://community.notepad-plus-plus.org/topic/18031/tabs-in-python</link><generator>RSS for Node</generator><lastBuildDate>Fri, 11 Sep 2026 07:59:17 GMT</lastBuildDate><atom:link href="https://community.notepad-plus-plus.org/topic/18031.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 01 Aug 2019 05:38:20 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Tabs in python on Fri, 16 Aug 2019 20:43:06 GMT]]></title><description><![CDATA[<p dir="auto">Another victim of PEP 8.</p>
<p dir="auto">Frenzy Frenzy, I agree with Peter Jones that inconsistency is the issue here. That said, I presume that <em>you</em> were being consistent and that npp silently changed your tabs to spaces, per its default behavior (yea for npp for following the rules; boo for the PEP 8 authors for making that rule).</p>
<p dir="auto">It shouldn’t have been an issue if you were starting a module from scratch, but would definitely lead to problems if you were editing existing code that already contained real tabs. Once the code is hosed, you have a few options in npp for cleaning it up:</p>
<ul>
<li>
<p dir="auto">View the white space characters, per Alan Kilborn’s post, and manually fix them</p>
</li>
<li>
<p dir="auto">Use the <em>TAB to space</em> option Peter cites - or, ideally, it’s inverse operations, <strong>Space to TAB (All)</strong> and <strong>Space to TAB (Leading)</strong></p>
</li>
<li>
<p dir="auto">Use <strong>Search</strong> &gt; <strong>Replace</strong> with the <strong>Search Mode</strong> &gt; <strong>Extended</strong> option to manually find or replace tab characters using their special <strong>\t</strong> representation</p>
</li>
</ul>
<p dir="auto">The automatic space-to-tab converters are good, but bulk operations inevitably (and understandably) overgeneralize. While time consuming, the third option gives you more control over the process, with some level of automation.</p>
<p dir="auto">FWIW, I’m +1 with you for using tabs. I’m always amused (or perhaps bemused) that right at the top of PEP 8 is a section called “<em>A Foolish Consistency is the Hobgoblin of Little Minds</em>”, followed immediately by the first, and most foolish, of its recommendations - to use spaces instead of tabs (which many in the Python community follow consistently, admittedly with good intentions).</p>
<p dir="auto">I’ll refrain from commenting on the merits of tabs; there’s plenty on the web about that already. Suffice it to say, there’s a large community of Python programmers that agree with your approach.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/46318</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/46318</guid><dc:creator><![CDATA[Michael Mannion]]></dc:creator><pubDate>Fri, 16 Aug 2019 20:43:06 GMT</pubDate></item><item><title><![CDATA[Reply to Tabs in python on Mon, 05 Aug 2019 12:34:52 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></p>
<p dir="auto">:-D - maybe, hopefully using <a href="https://github.com/dail8859/cookiecutter-npp-cpp-plugin" rel="nofollow ugc">cookiecutter </a> :-D</p>
<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/ajay-gohil" aria-label="Profile: ajay-gohil">@<bdi>ajay-gohil</bdi></a> - no offense.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/45947</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/45947</guid><dc:creator><![CDATA[Ekopalypse]]></dc:creator><pubDate>Mon, 05 Aug 2019 12:34:52 GMT</pubDate></item><item><title><![CDATA[Reply to Tabs in python on Mon, 05 Aug 2019 12:14:22 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/ekopalypse" aria-label="Profile: Ekopalypse">@<bdi>Ekopalypse</bdi></a></p>
<p dir="auto">Suspect <a class="plugin-mentions-user plugin-mentions-a" href="/user/ajay-gohil" aria-label="Profile: ajay-gohil">@<bdi>ajay-gohil</bdi></a> is in the kitchen, <a href="https://notepad-plus-plus.org/community/topic/15958/faq-desk-you-ve-asked-your-question-in-the-wrong-place" rel="nofollow ugc">baking</a>.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/45946</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/45946</guid><dc:creator><![CDATA[Alan Kilborn]]></dc:creator><pubDate>Mon, 05 Aug 2019 12:14:22 GMT</pubDate></item><item><title><![CDATA[Reply to Tabs in python on Mon, 05 Aug 2019 10:29:07 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/ajay-gohil" aria-label="Profile: ajay-gohil">@<bdi>ajay-gohil</bdi></a></p>
<p dir="auto">Don’t get your point, what exactly are you referring to?</p>
]]></description><link>https://community.notepad-plus-plus.org/post/45941</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/45941</guid><dc:creator><![CDATA[Ekopalypse]]></dc:creator><pubDate>Mon, 05 Aug 2019 10:29:07 GMT</pubDate></item><item><title><![CDATA[Reply to Tabs in python on Mon, 05 Aug 2019 04:16:09 GMT]]></title><description><![CDATA[<p dir="auto">The \t inside the string is the escape sequence for the horizontal tabulation.<br />
f = open(filename, ‘w’)<br />
f.write(“hello\talex”)</p>
]]></description><link>https://community.notepad-plus-plus.org/post/45932</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/45932</guid><dc:creator><![CDATA[ajay gohil]]></dc:creator><pubDate>Mon, 05 Aug 2019 04:16:09 GMT</pubDate></item><item><title><![CDATA[Reply to Tabs in python on Fri, 02 Aug 2019 12:49:38 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/ekopalypse" aria-label="Profile: Ekopalypse">@<bdi>Ekopalypse</bdi></a> said:</p>
<blockquote>
<p dir="auto">I know is must be quite early over there in the states</p>
</blockquote>
<p dir="auto">Click original pep link, then SCROLL UP Alan!!</p>
]]></description><link>https://community.notepad-plus-plus.org/post/45871</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/45871</guid><dc:creator><![CDATA[Alan Kilborn]]></dc:creator><pubDate>Fri, 02 Aug 2019 12:49:38 GMT</pubDate></item><item><title><![CDATA[Reply to Tabs in python on Fri, 02 Aug 2019 12:46: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></p>
<p dir="auto">yep, <a href="https://www.python.org/dev/peps/pep-0008/#indentation" rel="nofollow ugc">4 spaces</a> is recommended :-)<br />
I know is must be quite early over there in the states ;-D</p>
]]></description><link>https://community.notepad-plus-plus.org/post/45868</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/45868</guid><dc:creator><![CDATA[Ekopalypse]]></dc:creator><pubDate>Fri, 02 Aug 2019 12:46:42 GMT</pubDate></item><item><title><![CDATA[Reply to Tabs in python on Fri, 02 Aug 2019 12:28:00 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/ekopalypse" aria-label="Profile: Ekopalypse">@<bdi>Ekopalypse</bdi></a></p>
<p dir="auto">I thought it was recommended that FOUR spaces = one indent level as well, but maybe my memory is faulty on that as I don’t see it in the pep8 link.</p>
<p dir="auto">Regardless, it is nice that N++ gives one the choice of whatever they want in regards to this.  Obviously best to not mix them, however.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/45863</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/45863</guid><dc:creator><![CDATA[Alan Kilborn]]></dc:creator><pubDate>Fri, 02 Aug 2019 12:28:00 GMT</pubDate></item><item><title><![CDATA[Reply to Tabs in python on Fri, 02 Aug 2019 12:02:29 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/frezy-frezy" aria-label="Profile: Frezy-Frezy">@<bdi>Frezy-Frezy</bdi></a></p>
<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/peterjones" aria-label="Profile: PeterJones">@<bdi>PeterJones</bdi></a>  is right, as of <a href="https://www.python.org/dev/peps/pep-0008/#tabs-or-spaces" rel="nofollow ugc">pep8</a> it is recommended to use spaces instead of tabs.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/45860</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/45860</guid><dc:creator><![CDATA[Ekopalypse]]></dc:creator><pubDate>Fri, 02 Aug 2019 12:02:29 GMT</pubDate></item><item><title><![CDATA[Reply to Tabs in python on Thu, 01 Aug 2019 13:27:01 GMT]]></title><description><![CDATA[<p dir="auto">Perhaps enabling <code>View</code> menu &gt; <code>Show Symbol</code> &gt; <code>Show White Space and TAB</code> will help <a class="plugin-mentions-user plugin-mentions-a" href="/user/frezy-frezy" aria-label="Profile: Frezy-Frezy">@<bdi>Frezy-Frezy</bdi></a> until this is sorted out…whether by the use of the conversion Peter suggests or otherwise.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/45824</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/45824</guid><dc:creator><![CDATA[Alan Kilborn]]></dc:creator><pubDate>Thu, 01 Aug 2019 13:27:01 GMT</pubDate></item><item><title><![CDATA[Reply to Tabs in python on Thu, 01 Aug 2019 13:17:19 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/ekopalypse" aria-label="Profile: Ekopalypse">@<bdi>Ekopalypse</bdi></a> is right, as far as <a href="http://notepad-plus-plus.github.io/npp-usermanual/content/preferences/#language" rel="nofollow ugc">choosing whether the TAB button inserts the tab character or a number of spaces</a>.  However:</p>
<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/frezy-frezy" aria-label="Profile: Frezy-Frezy">@<bdi>Frezy-Frezy</bdi></a> said:</p>
<blockquote>
<p dir="auto">The problem is that is ruining the code and I cannot run it. Any solution?</p>
</blockquote>
<p dir="auto"><em>Being inconsistent</em> is what’s ruining your code.  Python works just fine if all the indents are spaces.  Python works just fine if all the indents are tabs.  The Python references I’ve seen actually recommend spaces, not tabs.  If you’d like to leave the tab-to-space settings as-is, you can instead use <strong>Edit &gt; Blank Operations &gt; TAB to space</strong> to convert your existing codebase to use <em>only</em> spaces, instead of a mixture.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/45822</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/45822</guid><dc:creator><![CDATA[PeterJones]]></dc:creator><pubDate>Thu, 01 Aug 2019 13:17:19 GMT</pubDate></item><item><title><![CDATA[Reply to Tabs in python on Thu, 01 Aug 2019 08:49:03 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/frezy-frezy" aria-label="Profile: Frezy-Frezy">@<bdi>Frezy-Frezy</bdi></a></p>
<p dir="auto">goto <em>Settings-&gt;Preferences-&gt;Language</em> select <strong>python</strong> from <em>available items</em> and<br />
uncheck <em>replace by space</em></p>
]]></description><link>https://community.notepad-plus-plus.org/post/45810</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/45810</guid><dc:creator><![CDATA[Ekopalypse]]></dc:creator><pubDate>Thu, 01 Aug 2019 08:49:03 GMT</pubDate></item></channel></rss>