[Tutor] File IO

Amadeo Bellotti amadeo.bellotti at gmail.com
Wed Aug 30 01:54:53 CEST 2006


no no the file shows up in the same directory as the .py file and i no it
works cause i read the text file

On 8/29/06, Alan Gauld <alan.gauld at freenet.co.uk> wrote:
>
>
> >i do and they have writing but its just not printing it at all
> >
>
> How do you know? Where are you looking for the file?
> Are you sure its not a Path issue?
>
> Alan G.
>
>
> > On 8/29/06, Kent Johnson <kent37 at tds.net> wrote:
> >>
> >> Amadeo Bellotti wrote:
> >> > Ok im trying to create a file that the user chooses the name of
> >> > and
> >> print a
> >> > varible that is a string to the text file. but for some reason
> >> > whne i do
> >> > this code:
> >> >
> >> > FILE = open(filename, "w")
> >> > FILE.write(puzzleanswers)
> >> > FILE.close()
> >> >
> >> > it doesnt write anything does anyone know how to fix it  so it
> >> > works?
> >>
> >> I would
> >> print filename
> >> print puzzleanswers
> >>
> >> to make sure you know what should happen.
> >>
> >> Kent
> >>
> >> _______________________________________________
> >> Tutor maillist  -  Tutor at python.org
> >> http://mail.python.org/mailman/listinfo/tutor
> >>
> >
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/tutor/attachments/20060829/3d509f55/attachment.html 


More information about the Tutor mailing list