Python OS Module
Operating system interface — file operations, paths, environment variables. This category documents 45 Python os module entries, and each page gives you the full syntax, the parameter list, the return value, and a runnable example. The entries include: os.getcwd(), os.chdir(), os.listdir(), os.mkdir(), os.makedirs(), os.remove(), os.rmdir(), os.removedirs(), os.rename(), os.replace(), os.stat(), os.walk(), os.environ, os.getenv(), os.putenv(), os.uname(), os.getpid(), os.system(), os.popen(), os.name, os.sep, os.linesep, os.path.join(), os.path.exists(), os.path.isfile(), os.path.isdir(), os.path.basename(), os.path.dirname(), os.path.split(), os.path.splitext(), and more. os.getcwd() returns the current working directory as a string. os.chdir() changes the current working directory to the given path. os.listdir() returns a list of all files and directories in the given path. os.mkdir() creates a single directory. Raises FileExistsError if it already exists. os.makedirs() creates all intermediate directories as needed (like mkdir -p).