You are here : python_2osostmpnam

os.tmpnam() - os

             

The method tmpnam() returns a unique path name that is reasonable for creating a temporary file.


  • NA


Syntax


os.tmpnam()


Example


# !/usr/bin/python

import os, sys

# Temporary file generated in current directory
tmpfn = os.tmpnam()

print "This is the unique path:"
print tmpfn


Output / Return Value

When we run above program, it produces following result:


This is the unique path: /tmp/fileUFojpd


Limitations


Alternatives / See Also


Reference