exists=false, but no complaint when i open it!?

John Machin sjmachin at lexicon.net
Thu May 15 12:16:42 EDT 2008


On May 16, 2:03 am, globalrev <skanem... at yahoo.se> wrote:
> print os.path.exists('C:\Users\saftarn\Desktop\NetFlixDataSet
> \trainingsetunzipped\training_set\mv_0000001.txt')
>
> d=open('C:/Python25/myPrograms/mapexperiments/maps/provinces-of-
> sweden.gif')
> d.close()
>
> exists returns false but when i open it doesnt complain. how come?
>
> another file that exists returned false for complained when i tried to
> open it.

Ummm ... you are testing one path with os.path.exists and then opening
a *DIFFERENT* path. If you think you still have a problem, show us a
short piece of code that you actually executed and that demonstrates
the problem.



More information about the Python-list mailing list