[Tutor] Re: Tutor digest, Vol 1 #1863 - 5 msgs

python python <python@inkedmn.net>
Tue, 20 Aug 2002 14:00:31 -0700


Hello,

i think that it does, here's some code from IDLE:

>>> file = open('c:\somestuff.txt', 'w')
>>> file.write('hello, this is a test')
>>> file.close()
>>> file = open('c:\somestuff.txt', 'r')
>>> stuff = file.read()
>>> print stuff
>>> hello, this is a test

that seemed to work (i know, using the 'open' command instead of the
'file' command)...

brett


CC> On 2002-08-20 at 16:00:05 [+0000], you wrote:
>> > file = file('C:\filename.txt', 'w')
>> > x = 'hello, sir'
>> > file.write(x)

CC> I may have missed this earlier but "c:\filename.txt" in Python does not
CC> equal c:\filename.txt in a windows box. It has to be "c:/filename.txt" or
CC> "c:\\filename.txt"

CC> Charlie
CC> --
CC> Charlie Clark
CC> Helmholtzstr. 20
CC> Dsseldorf
CC> D- 40215
CC> Tel: +49-211-938-5360
CC> GSM: +49-178-782-6226

CC> _______________________________________________
CC> Tutor maillist  -  Tutor@python.org
CC> http://mail.python.org/mailman/listinfo/tutor



-- 
Best regards,
 python                            mailto:python@inkedmn.net