There are a number of problems:
- The syntax of your
path.replaceline is incorrect.\is an escape character and as such it needs to be escaped by prepending another\. path.replaceworks the other way around: first the thing you want to substitute, then the thing you want to substitute it with.- Your string doesn't contain all of the backslashes anymore, because they have been interpreted as ... escape characters. You need to create a "raw" string.
Putting it all together:
path = r"/Users/xx/datasets/yyy/DefinedTS\Training\00000"
path = path.replace("\\", "/")
print(path)