removing blank lines after text on a file python
<p>I have a python program with generates a file.<br>
I want to remove the lines with spaces at the end<br>
my program outputs a file like this:</p>

<pre><code>&gt; cat output
some text

some text



&gt;
</code></pre>

<p>The output that I need is:</p>

<pre><code>&gt; cat output
some text

some text
&gt;
</code></pre>

<p>Thanks in advance</p>

<p>I believe that underneath your print("") statement there are a few blank lines inserted. Try to check if that is the case, if not just paste your code so I can check it out.</p>

python file