title: Convert RGB from string to number and back
body: <p>I hold RGB values as a 9 character string. For various reasons I need to convert this into an integer, then back again to a 9 character string.</p>
  
  <pre><code>String1 = '000004000'   # almost black
  Num = int(String1)
  print Num
  &gt;&gt;&gt; 2048
  String2 = ????(Num)
  print String2
  &gt;&gt;&gt; 000004000
  </code></pre>
  
  <p>How can I do that ?</p>