os.access()

Test file permissions:

In [9]: import os

In [10]: os.access( "/online_dir/online.xml", os.R_OK)
Out[10]: True

In [11]: os.access( "/online_dir/online.xml", os.X_OK)
Out[11]: False

In [12]: os.access( "/online_dir/online.xmllll", os.R_OK)
Out[12]: False