pbn
pbn

Reputation: 2706

Convert windows relative path to linux relative path

Given the windows relative path that always starts with a directory name e.g.:

a\\b\\c

I want to convert it to linux style path path:

a/b/c

taking into consideration all the possible differences between path formats (if any).

Upvotes: 0

Views: 2432

Answers (1)

BadRequest
BadRequest

Reputation: 382

Use PathLib : https://docs.python.org/3/library/pathlib.html1

The side of yours \ will be replaced by /. So you can use / with Windows as UNIX path

Upvotes: 2

Related Questions