title: How can I determine a Unicode character from its name in Python, even if that character is a control character?
body: <p>I'd like to create an array of the Unicode code points which constitute white space in JavaScript (minus the Unicode-white-space code points, which I address separately).  These characters are horizontal tab, vertical tab, form feed, space, non-breaking space, and BOM.  I could do this with magic numbers:</p>
  
  <pre><code>whitespace = [0x9, 0xb, 0xc, 0x20, 0xa0, 0xfeff]
  </code></pre>
  
  <p>That's a little bit obscure; names would be better.  The <code>unicodedata.lookup</code> method passed through <code>ord</code> helps some:</p>
  
  <pre><code>&gt;&gt;&gt; ord(unicodedata.lookup("NO-BREAK SPACE"))
  160
  </code></pre>
  
  <p>But this doesn't work for 0x9, 0xb, or 0xc -- I think because they're control characters, and the "names" FORM FEED and such are just alias names.  Is there any way to map these "names" to the characters, or their code points, in standard Python?  Or am I out of luck?</p>