[Tutor] how to check whether a file exists or not??
ziad.rahhal at gmail.com
Thu Oct 12 17:00:53 CEST 2006
On 10/12/06, Asrarahmed Kadri <ajkadri at googlemail.com> wrote:
> Sorry, but this is a very basic questions...
> Can you tell me how to check the existence of a file..
to check if a file exists, you can use os.path.exists(path)
or look at http://python.org/doc/current/lib/module-os.path.html for
Also if a file exists, and we open it in a write mode, it would be truncated
> to zero length. So what is the way out of this??#
> To HIM you shall return.
> Tutor maillist - Tutor at python.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Tutor