Access judge python file

os.access (file, mode)
is determined file access
file as the file
mode is an operation mode, there are so few:
os.F_OK: Check whether the file exists;
os.R_OK: check the file is readable;
os.W_OK: Check whether the file can be written;
os.X_OK: check whether the file can be executed;

 

Guess you like

Origin www.cnblogs.com/WebLinuxStudy/p/11992204.html