os.path.join() method in Python
The os.path.join() Method in Python joins one or more path components intelligently. This method concatenates various path components with exactly one directory separator (‘/’) following each non-empty part except the last path component. If the last path component to be joined is empty then a directory separator (‘/’) is put at the end.
If a path component represents an absolute path, then all previous components joined are discarded, and joining continues from the absolute path component.
Python | os.path.join() method
Os Path Module is a sub-module of the OS module in Python used for common pathname manipulation. In this article, we will learn about os.path.join() and handling file paths safely in Python OS.