def is_readable ( filename ) : return os . path . isfile ( filename ) and os . access ( filename , os . R_OK )
python check file is readonly
Check if file is a regular file and is readable .
def is_readable(filename):
    """Check if file is a regular file and is readable."""
    return os.path.isfile(filename) and os.access(filename, os.R_OK)