Python - Fastest way to clear the screen?
<p>What would the fastest way to clear the screen, be?</p>

<p>I've tried many solutions, they seem to work, however, I need the fastest way. Could anyone point me in the right direction?</p>

<p>The screen, in my case, is a command prompt.</p>

<p>I've edited my question for better understandings.</p>

<p>Any help welcomed :)</p>

<p>One portable solution could be:</p>

<pre><code>def clear_sceen():
    os.system('cls' if os.name == 'nt' else 'clear')
</code></pre>

<p>Another possible way would be using:</p>

<pre><code>print(chr(27) + "[2J")
</code></pre>

<p>Although this one wouldn't be really a portable solution</p>

python cmd screen line clear