Python it determines whether the folders and files exist

1.os.path.exists ()
both determine whether a file exists, and can determine whether there is a folder

2.os.path.isfile ()
to determine whether a file exists

3.os.path.isdir ()
to determine whether there is a folder

 

Guess you like

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