title: Generate temporary file names without creating actual file in Python
body: <p>Answers to <a href="https://stackoverflow.com/questions/10501247/best-way-to-generate-random-file-names-in-python">Best way to generate random file names in Python</a> show how to create temporary files in Python.</p>
  <p>I only need to have a temporary file name in my case.<br />
  Calling <code>tempfile.NamedTemporaryFile()</code> returns a file handle after actual file creation.</p>
  <p>Is there a way to get a filename only? I tried this:</p>
  <pre><code># Trying to get temp file path
  tf = tempfile.NamedTemporaryFile()
  temp_file_name = tf.name
  tf.close()
  # Here is my real purpose to get the temp_file_name
  f = gzip.open(temp_file_name ,'wb')
  ...
  </code></pre>