Answers for "python forward and bachward seperators"

0

python forward and bachward seperators

import os

path = "C:\\temp\myFolder\example\\"

newPath = path.replace(os.sep, '/')

print newPath


Output:<< C:/temp/myFolder/example/  >>
Posted by: Guest on June-12-2020
0

python forward and bachward seperators

s.replace('\\', '/')
Posted by: Guest on June-12-2020
0

python forward and bachward seperators

posixpath.join(*s.split('\\'))
Posted by: Guest on June-12-2020
0

python forward and bachward seperators

os.path.join(*s.split('\\'))
Posted by: Guest on June-12-2020

Python Answers by Framework

Browse Popular Code Answers by Language