The OS module contains common operating system features, and the following list of commonly used commands is as follows:
1. Os.sep: Change the path delimiter in the operating system
2. OS.GETCWD (): Gets the current path, which is more commonly used in Python code
3. Os.listdir (): Lists all files and folders in the current directory
4. Os.remove (): Delete the specified file
5. Os.system (): Run shell command
6. Os.chdir (): Change the current directory to the specified directory
7. Os.name (): Judging the platform that is now being used, Windows returns ' NT '; Linux returns ' POSIX '
8. Os.rmdir (): Delete the specified directory
9. Os.mkdir (): Create directory
Os.path.abspath (): Return the absolute path of path
Os.path.split (): Breaks the path into (folder, file name), returns the tuple type
Os.path.basename (): Returns the file name in path
Os.path.getmtime (): The last modification time of a file or folder, from the new era to the number of seconds to access it
Os.path.getatime (): Last access time for a file or folder, from new era to the number of seconds to access
Os.path.getctime (): The time the file or folder was created, from the new era to the number of seconds it was accessed
Os.path.getsize (): The size of the file or folder, if the folder returns 0
Os.path.isfile (): Determines whether the specified object is a file
Os.path.isdir (): Determines whether the specified object is a directory
Os.path.exists (): Verifies that the specified object exists
Os.path.join (): Connection directory and file name
Os.path.dirname (): Return file path
Python OS module Common features