【Python】os.path

2023-04-15  本文已影响0人  盐果儿

os.path is a module in Python's standard library that provides functions for working with file paths and directory paths in a platform-independent way.

os.path.join(): joins two or more path components intelligently, taking into account the operating system's path separator.

os.path.exists(): returns True if a file or directory path exists and False otherwise.

os.path.abspath(): returns the absolute path of a file or directory.

os.path.dirname(): returns the directory component of a path.

上一篇下一篇

猜你喜欢

热点阅读