title: In Python 3 how to print unicode codepoint as u'\U...'
body: <p>For whatever reason, I thought it would be neat to create a table of emoji I'm interested in.  First column would be the codepoint, second the emoji, third the name.  SOmething along the lines of this web page, but tailored to my use.</p>
  
  <p><a href="http://www.unicode.org/emoji/charts/full-emoji-list.html#1f605" rel="nofollow noreferrer">Full emoji data</a></p>
  
  <p>Assuming I figure out how to iterate on the codepoints (there are other questions for that or I construct a list of interest) then I will just cycle through the code points such as </p>
  
  <pre><code>u_str = u'\U0001F001'
  u_str = u'\U0001F002'
  </code></pre>
  
  <p>(generated programmatically of course)</p>
  
  <p>and print (in a loop):</p>
  
  <pre><code>print(u'\U0001F001', u_str, ' ', unicodedata.name(u_str))
  print(u'\U0001F002', u_str, ' ', unicodedata.name(u_str))
  </code></pre>
  
  <p>If there was an ability to use unicodedata and some attribute such as unicodedata.hex_representation then I would just use that, but if there is that attribute in unicodedata, I don't understand the spec to see it.</p>
  
  <p>So in searching for an answer I found this question:</p>
  
  <p><a href="https://stackoverflow.com/questions/27435855/how-does-one-print-a-unicode-character-code-in-python">how-does-one-print-a-unicode-character-code-in-python</a></p>
  
  <p>I attempt:</p>
  
  <pre><code>&gt;&gt;&gt; print(u_str.encode('raw_unicode_escape'))
  b'\\U0001f600'
  </code></pre>
  
  <p>what I'm looking for is what I put in:</p>
  
  <pre><code>u_str = u'\U0001F600'
  </code></pre>
  
  <p>Is this possible or is there some other way to achieve the construction of the table?</p>