file_path

file_path(*args)

Construct a path to a file or paths to files

Parameters

Name Type Description Default
*args Paths, subfolders and files of either length 1 or a list with a fixed length. See the examples. ()

Returns

Name Type Description
Union[str, List[str]] a str with the path to a file or a list of paths to files

Examples

>>> from rlike import *
>>> x = file_path(tempdir(), 'level1', 'level2', 'myfile.txt')
>>> x = file_path(tempdir(), 'level1', 'level2', ['myfile.txt', 'test.pickle'])
>>> x = file_path([tempdir(), tempdir()], ['myfile.txt', 'test.pickle'])