tempfile.NamedTemporaryFile wont work

Bjoern Schliessmann usenet-mail-0306.20.chr0n0ss at spamgourmet.com
Sun Nov 19 07:18:39 EST 2006


Imbaud Pierre wrote:

>              tf = tempfile.NamedTemporaryFile()
>              tfName = tf.name
> [...]
>              print >> sys.stderr, '%s: %s' % (tfName, ['no',
> 'yes'][os.path.exists(tfName)])
>              subprocess.Popen(['strings', tfName])

Just out of curiosity: Why did you assign tf.name to tfname?

Hypothetically, if tf.name changed, tfname wouldn't follow since
strings are immutable.

Regards,


Björn

-- 
BOFH excuse #149:

Dew on the telephone lines.




More information about the Python-list mailing list