Python os.path.join() Method Syntax
Syntax: os.path.join(path, *paths)
Parameter:
- path: A path-like object representing a file system path.
- *path: A path-like object representing a file system path. It represents the path components to be joined. A path-like object is either a string or bytes object representing a path.
- Note: The special syntax *args (here *paths) in function definitions in python is used to pass a variable number of arguments to a function.
Return Type: This method returns a string which represents the concatenated path components.
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.