def make_temp_fname(fname=None):
 suffix = os.path.split(fname)[(-1)]
 (fd, temp_prefix) = tempfile.mkstemp(prefix='tmp', suffix=suffix)
 return temp_prefix

def make_temp_fname ( fname = None ) : suffix = os . path . split ( fname ) [ ( - 1 ) ] ( fd , temp_prefix ) = tempfile . mkstemp ( prefix = 'tmp' , suffix = suffix ) return temp_prefix
safe temp name - preserve the file extension for tools that interpret it .