Testing for a file in python?

Thaddeus L. Olczyk olczyk at interaccess.com
Tue Jun 13 00:12:19 EDT 2000


On Mon, 12 Jun 2000 20:10:48 +0300 (IDT), Moshe Zadka
<moshez at math.huji.ac.il> wrote:

>> How would you go about testing if a certain file exists in python?
>> In most scripting languages you have the -f test:
>
>I don't know what you mean by "most".
For all those who emailed me ( especially the nasty ones ) suggesting
that I'm slamming Python in favor of Perl ( which I know well enough
to know, I don't like it )  by most I mean:

sh,csh,bash,tcsh,zsh ( and OK Perl )

ones that I seem to remember it being in but am not quite sure:

ksh, awk.

Ones that I'm sure don't do it
Python, sed ( and I'm not sure about sed, it's just not likely to be
there ).




More information about the Python-list mailing list