1, Nt.pyos.chdir () modify the current working directory to the specified directory Os.chmod () modify the access rights of a file Os.chown () modify the owner and owner group of one directory to another number, the owner group Os.chroot () modifies the root directory ( Used under Liunx) Os.ctermid () returns the name of the console of a process os.getcwd () displays the current working directory in string format (working directory of the Python interpreter) Os.getegid () Gets the active group of the current process idos.getenv ( Gets the system environment variable, the environment variable does not exist when the return Noneos.geteuid () Gets the active user of the current process Idos.getgid () gets the group Idos.getgrouplist () of the active process Returns a list of the base groups for the specified user os.getgroups () gets a list of additional group IDs for a process os.getloadavg () returns the current one tuple consisting of 1 minutes, 5 minutes, and 15 minutes of average payload usage os.getlogin () Returns the actual logged on user name of the current system Os.getpid () returns the current process ID number Os.getppid () returns the ID number of the current process's parent process Os.getuid () returns the user of the current process Idos.kill () ends a process os.killpg () End a process group Os.listdir () returns a list of all the files under the specified path, without specifying a path that defaults to the current path Os.lseek () and returns the position of the pointer to the specified file Os.major () Gets the main device number of a device file Os.makedev () creates a new device file on the system Os.makedirs () recursively creates a multilayer directory, if the target directory already exists, then error Os.minor () Gets the secondary device number of a device file Os.mkdir () Create a directory Os.mkfifo () creates a pipeline file Os.nice () adds a property to a process, which modifies the nice value of a process Os.open () opens the file at the hardware level, returning an integer file descriptor os.putenv () Modify or add an environment variable os.read () to read the file descriptor of the specified file, return the Byte object Os.remove () delete the specified file Os.removedirs () delete the multi-level directory Os.rename () rename a file or directory Os.rmdir () Delete a directory OS.Setegid () Sets the active group of the current process Idos.seteuid () sets the current process's active user Idos.setgid () sets the current process's group Idos.setuid () to set the user Idos.stat for the current process () Displays details of the specified path Os.strerror () converts the error number to an information string Os.symlink () creates a soft link for the specified directory Os.sync () forces the content to be written to disk Os.system () Executes a system command in a child shell Os.times () returns a collection of system time Information Os.umask () for a file or directory setting and returns a new permission mode Os.uname () returns the kernel information for the current operating system Os.unlink () Delete a soft link os.unsetenv () deletes an environment variable os.utime () sets the last access time and last modified time for the specified path Os.walk () the given directory name, returning a tuple of the current directory name, the subdirectory of the current directory, and the normal files in the current directory
Python OS module