Hello
I'm sure its basic but I'm confused about the error I get with the
following code. Any help on basic tempfile usage?
ActivePython 2.4.1 Build 247 (ActiveState Corp.) based on
Python 2.4.1 (#65, Jun 20 2005, 17:01:55) [MSC v.1310 32 bit (Intel)]
on win32
Type "help", "copyright" , "credits" or "license" for more information.[color=blue][color=green][color=darkred]
>>>
>>> from tempfile import NamedTemporaryF ile
>>>
>>> tmp = NamedTemporaryF ile()
>>> tmp.write("Hell o")
>>> tmp.close()
>>>
>>> print tmp.name[/color][/color][/color]
c:\docume~1\ger ard\locals~1\te mp\tmpxqn4yl[color=blue][color=green][color=darkred]
>>>
>>> f = open(tmp.name)[/color][/color][/color]
Traceback (most recent call last):
File "<stdin>", line 1, in ?
IOError: [Errno 2] No such file or directory:
'c:\\docume~1\\ gerard\\locals~ 1\\temp\\tmpxqn 4yl'
Thanks
Gerard
I'm sure its basic but I'm confused about the error I get with the
following code. Any help on basic tempfile usage?
ActivePython 2.4.1 Build 247 (ActiveState Corp.) based on
Python 2.4.1 (#65, Jun 20 2005, 17:01:55) [MSC v.1310 32 bit (Intel)]
on win32
Type "help", "copyright" , "credits" or "license" for more information.[color=blue][color=green][color=darkred]
>>>
>>> from tempfile import NamedTemporaryF ile
>>>
>>> tmp = NamedTemporaryF ile()
>>> tmp.write("Hell o")
>>> tmp.close()
>>>
>>> print tmp.name[/color][/color][/color]
c:\docume~1\ger ard\locals~1\te mp\tmpxqn4yl[color=blue][color=green][color=darkred]
>>>
>>> f = open(tmp.name)[/color][/color][/color]
Traceback (most recent call last):
File "<stdin>", line 1, in ?
IOError: [Errno 2] No such file or directory:
'c:\\docume~1\\ gerard\\locals~ 1\\temp\\tmpxqn 4yl'
Thanks
Gerard
Comment