“Python Forward e Bachward Seperators” Respostas de código

Python Forward e Bachward Seperators

import os

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

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

print newPath


Output:<< C:/temp/myFolder/example/  >>
Super Sandpiper

Python Forward e Bachward Seperators

s.replace('\\', '/')
Super Sandpiper

Python Forward e Bachward Seperators

posixpath.join(*s.split('\\'))
Super Sandpiper

Python Forward e Bachward Seperators

os.path.join(*s.split('\\'))
Super Sandpiper

Respostas semelhantes a “Python Forward e Bachward Seperators”

Perguntas semelhantes a “Python Forward e Bachward Seperators”

Procure respostas de código populares por idioma

Procurar outros idiomas de código