title: How to postpone/defer the evaluation of f-strings?
body: <p>I am using template strings to generate some files and I love the conciseness of the new f-strings for this purpose, for reducing my previous template code from something like this:</p>
  
  <pre><code>template_a = "The current name is {name}"
  names = ["foo", "bar"]
  for name in names:
      print (template_a.format(**locals()))
  </code></pre>
  
  <p>Now I can do this, directly replacing variables:</p>
  
  <pre><code>names = ["foo", "bar"]
  for name in names:
      print (f"The current name is {name}")
  </code></pre>
  
  <p>However, sometimes it makes sense to have the template defined elsewhere — higher up in the code, or imported from a file or something. This means the template is a static string with formatting tags in it. Something would have to happen to the string to tell the interpreter to interpret the string as a new f-string, but I don't know if there is such a thing.</p>
  
  <p><strong>Is there any way to bring in a string and have it interpreted as an f-string to avoid using the <code>.format(**locals())</code> call?</strong></p>
  
  <p>Ideally I want to be able to code like this... (where <code>magic_fstring_function</code> is where the part I don't understand comes in):</p>
  
  <pre><code>template_a = f"The current name is {name}"
  # OR [Ideal2] template_a = magic_fstring_function(open('template.txt').read())
  names = ["foo", "bar"]
  for name in names:
      print (template_a)
  </code></pre>
  
  <p>...with this desired output (without reading the file twice):</p>
  
  <pre class="lang-none prettyprint-override"><code>The current name is foo
  The current name is bar
  </code></pre>
  
  <p>...but the actual output I get is:</p>
  
  <pre class="lang-none prettyprint-override"><code>The current name is {name}
  The current name is {name}
  </code></pre>