Detect existing files?

Marcin 'Qrczak' Kowalczyk qrczak at knm.org.pl
Wed May 2 14:35:18 EDT 2001


Wed, 2 May 2001 21:24:57 +0400 (MSD), Roman Suzi <rnd at onego.ru> pisze:

>>> Now my question: Is there a simple way to detect an existing file?
>>
>>os.path.exists?
> 
> I am using glob.glob(file) usually - and it is the slowest method :-(

It has a different meaning. For example it tells that the file "*"
is present if any file is present; but open("*") will fail unless
the file named "*" exists.

-- 
 __("<  Marcin Kowalczyk * qrczak at knm.org.pl http://qrczak.ids.net.pl/
 \__/
  ^^                      SYGNATURA ZASTĘPCZA
QRCZAK



More information about the Python-list mailing list