title: Octal string literals and octal command line arguments
body: <p>I have an octal string <code>"\334\n\226"</code> (the <code>\n</code> is not in octal because it has a printable ASCII representation). I would like to encode this in a bytes array, so I would like to convert <code>"\334\n\226"</code> -> <code>[\334, \n, \226]</code> -> <code>[220, 10, 150]</code>. I thought to write the following code:</p>
  
  <pre><code>octal_string = "\334\n\226"
  encoded_string = octal_string.encode()
  for b in encoded_string:
    print(b)
  </code></pre>
  
  <p>This outputs:</p>
  
  <blockquote>
    <p>195
    156
    10
    194
    150</p>
  </blockquote>
  
  <p>Additionally I would like to pass this string as a command line argument to my script so if I write the script:</p>
  
  <pre><code>import sys
  
  octal_string = sys.argv[1]
  encoded_string = octal_string.encode()
  for b in encoded_string:
    print(b)
  </code></pre>
  
  <p>Then I run:</p>
  
  <pre><code>&gt; python3 myscript.py \334\n\226
  </code></pre>
  
  <p>I get:</p>
  
  <blockquote>
    <p>51
    51
    52
    110
    50
    50
    54</p>
  </blockquote>
  
  <p>How am I supposed to do this?</p>