title: Python inserting variable string as file name
body: <p>I'm trying to create a file with a unique file name for every time my script runs. I am only intending to do this to every week or month. so I chose to use the date for the file name.</p>
  <pre><code>f = open('%s.csv', 'wb') %name
  </code></pre>
  <p>is where I'm getting this error.</p>
  <pre><code>Traceback (most recent call last):
  File &quot;C:\Users\User\workspace\new3\stjohnsinvoices\BabblevoiceInvoiceswpath.py&quot;, line 143,      in &lt;module&gt;
  f = open('%s.csv', 'ab') %name
  TypeError: unsupported operand type(s) for %: 'file' and 'str'
  </code></pre>
  <p>it works if I use a static filename, is there an issue with the open function, that means you can't pass a string like this?</p>
  <p>name is a string and has values such as :</p>
  <pre><code>31/1/2013BVI
  </code></pre>
  <p>Many thanks for any help.</p>