How to make equal space between words - python
<p>(SORRY FOR BAD ENGLISH)
Im working at cmd.
I want to do that thing:</p>

<pre><code>file_name              DIR
file_name_3            DIR
file_name_545          DIR
file_name_LlK          DIR
</code></pre>

<p>Instead of doing that thing:</p>

<pre><code>file_name          DIR
file_name_3          DIR
file_name_545          DIR
file_name_LlK          DIR
</code></pre>

<p>I tryied to do this in loop:</p>

<pre><code>print data.ljust((20 - len(data) + 20)) if len(data) &lt;= 20 else (data[0:17] + '...').ljust(20)), 'DIR'
</code></pre>

<p>But that thing not working becase there are letters bigger then another, then 'ljust' the words makes it not possible.</p>

<p>Use format strings.</p>

<pre><code>"{:20}{}".format(data,"DIR")
</code></pre>

<p>The same with <code>ljkust()</code></p>

<pre><code>data.ljust(20) + "DIR"
</code></pre>

<p>See <code>help(str.ljust)</code> to understand <code>ljust</code></p>

python