Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我需要以可移植的方式引用路径,shlex.quote将斜杠转换为/Windows,这会导致命令失败(使用默认的 Windows 命令提示符)。
shlex.quote
/
返回C:/Users/Me/Documents/Projects/Test
C:/Users/Me/Documents/Projects/Test
代替C:\Users\Me\Documents\Projects\Test
C:\Users\Me\Documents\Projects\Test
如何在 Windows 上引用路径,类似于shlex.quote使用本机斜杠,适用于 Windows 命令提示符和 BAT 文件?