Backslash replacement and file extension modification in file path
文件路径和名称:
xlsPath=D:\Python\files\文件.pdf
xlsPath = (filePath[:-3] + "xls")
print(xlsPath)
D:\Python\files\文件.xls
路径中的反斜杠替换
xlsPath=D:/Python/files/文件.xls
xlsPath=xlsPath.replace('\\', "/")
print(xlsPath)
D:/Python/files/文件.xls