In a Windows system, the path uses \. While the Linux system, the path uses/. \ is also an escape character, so there is a problem when using \.
If the luck is good, \ can not be escaped after the character, or can output normally:
Print ("C:\Program files\windows Media Player\wmplayer.exe")
The following is an escaped condition:
Print ("C:\Windows\notepad.exe")
To get the file path normally, you have to process the string.
Method One: The escape character \ \ means \:
Print ("C:\\windows\\notepad.exe")
This makes it cumbersome to process strings.
Method Two: string preceded by R or R declaration string do not escape:
Print (R "C:\Windows\notepad.exe")
Method Three: Python can also use/represent the path of Windows directly. "C:\Windows\notepad.exe" can be written directly as "C:/windows/notepad.exe".
If the relative path is used here, the code using/representing the path will work correctly on two platforms.
Python represents a file path in a Windows system