Os.listdir (Path=none)
--Output All files under current path os.listdir ()
#不给参数默认输出当前路径下所有文件Os.stat (Path, *, Dir_fd=none, follow_symlinks=true)
--#查看文件状态信息 Follow_symlinks True returns information about the file itself, flase and, if it is a soft link, displays the soft link itself.
In [9]: Os.stat (' t1 ', follow_symlinks=false)
#如果follow_symlinks指定为False, and the last element of the path is a symbolic link, chmod modifies the symbolic link itself rather than the file that the link points to.
OUT[13]: Os.stat_result (st_mode=41471, st_ino=1423520, st_dev=64768, St_nlink=1, St_uid=0, St_gid=0, st_size=4, St_ atime=1509156724, st_mtime=1509156722, st_ctime=1509156722)
Os.chmod (path, mode, *, Dir_fd=none, follow_symlinks=true)
--Modify Permissions os.chmod (' test2 ', 0o777)
#修改权限os.chown (path, UID, GID, *, Dir_fd=none, follow_symlinks=true)
--Change the owner or group of the file, but need to have sufficient permissions (root?)
os.chown (' test2 ', 1001,1001)
os.getcwd () # get current working directory
os.path.abspath ('. ' ) ) #获得当前工作目录
Os.path.abspath ('.. ' ) ) #获得当前工作目录的父目录
Os.path.abspath (os.curdir) #获得当前工作目录
Python--os