Windows path in Python

后端 未结 5 1734
悲哀的现实
悲哀的现实 2020-11-21 04:18

What is the best way to represent a Windows directory, for example \"C:\\meshes\\as\"? I have been trying to modify a script but it never works because I can\'t

5条回答
  •  情话喂你
    2020-11-21 05:10

    Use PowerShell

    In Windows, you can use / in your path just like Linux or macOS in all places as long as you use PowerShell as your command-line interface. It comes pre-installed on Windows and it supports many Linux commands like ls command.

    If you use Windows Command Prompt (the one that appears when you type cmd in Windows Start Menu), you need to specify paths with \ just inside it. You can use / paths in all other places (code editor, Python interactive mode, etc.).

提交回复
热议问题