1 Dec 2003 01:40
Re: inp. outp. & variable - dictionary difference ...
Alan Gauld <alan.gauld <at> blueyonder.co.uk>
2003-12-01 00:40:35 GMT
2003-12-01 00:40:35 GMT
> 1.) First I found out, after trying few times, closing Python,
and
> opening it again, that sometimes it open file (for
reading/writting),
> and sometimes just don't,
I'm guessing but how do you start Python? Could it be that you
are
sometimes starting it from the folder that the filesw are stored
in
and sometimres from some place else? Python will look in
"the current directory" for the files if you don't provide the
full path.
> I have also tryed what Danny suggested, some other method to
open file, :
>
> >>> inp = open("D:/Program
Files/Python/Lib/idlelib/Saves/ggg.txt") ...
> and the file was opened normally !!
>
> ... but in the very next line (of course after typing
inp.close() ), with
> inp = open("somefile.txt","r") method:
Note you used the full path first time but a relatoive path
second time.
Suggests you were not in
D:/Program Files/Python/Lib/idlelib/Saves
(Continue reading)
RSS Feed