[Tutor] checking if data files are good, readable, and exist

Bryan Fodness bryan.fodness at gmail.com
Tue Jul 22 17:40:39 CEST 2008

I would like to check to see if the data files are good, readable, and
exist.  I have checked to see if they exist, but their is a possibility that
the data file might be binary, and I would like to have a sys.exit for that
as well.

if not os.path.isfile(A_data) or not os.path.isfile(B_data)\
   or not os.path.isfile(C_data) or not os.path.isfile(D_data):

"The game of science can accurately be described as a never-ending insult to
human intelligence." - João Magueijo
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20080722/6e4e18e9/attachment.htm>

More information about the Tutor mailing list