pyufunc.path2linux#

pyufunc.path2linux(path)#

Convert path to linux path for all OSes.

Windows is smart enough to handle all paths from other OSes, but for other OSes, they can not handle windows paths. linux paths are friendly to all OSes, Finally, we decide convert to linux paths for all OSes.

Besides, the reason not use normalize_path or unify_path or path2uniform but path2linux is that: the author is a big fan of Linus Torvalds (Linux).

As an alternative, you can use path2uniform, which is the same as path2linux.

Location:

pyufunc/util_pathio/_path.py

Parameters:

path (str | Path) – _description_

Returns:

a unified linux path

Return type:

str

Examples

>>> import pyufunc as uf
>>> uf.path2linux('C:\\Users\\Administrator\\Desktop\\test\\test.txt')
'C:/Users/Administrator/Desktop/test/test.txt'
>>> uf.path2linux('./test.txt')
'C:/Users/Administrator/Desktop/test/test.txt'