title: How can you use a variable name inside a Python format specifier
body: <p>Is it possible to use a variable inside of a Python string formatting specifier?</p>
  
  <p>I have tried:</p>
  
  <pre><code>display_width = 50
  print('\n{:^display_width}'.format('some text here'))
  </code></pre>
  
  <p>but get a <code>ValueError: Invalid format specifier</code>.  I have also tried <code>display_width = str(50)</code></p>
  
  <p>however, just entering <code>print('\n{:^50}'.format('some text here'))</code> works just fine.</p>