Print all characters in a string
<p>Is there a way to print all characters in python, even ones which usually aren't printed?</p>

<p>For example</p>

<pre><code>&gt;&gt;&gt;print_all("skip
 line")
skip\nline
</code></pre>

<p>Looks like you want <a href="https://docs.python.org/3/library/functions.html#repr" rel="nofollow"><code>repr()</code></a></p>

<pre><code>&gt;&gt;&gt; """skip
... line"""
'skip\nline'
&gt;&gt;&gt;
&gt;&gt;&gt; print(repr("""skip
... line"""))
'skip\nline'
&gt;&gt;&gt; print(repr("skip    line"))
'skip\tline
</code></pre>

<p>So, your function could be </p>

<pre><code>print_all = lambda s: print(repr(s))
</code></pre>

<p>And for Python 2, you need <code>from __future__ import print_function</code></p>

python string