Dec-02-2020, 04:48 PM
The backslash is a special character. When you type
Change the line to:
'\'
, python thinks you're trying to put a single quote into a string, not terminate the string. To avoid this and have it insert a backslash, you need to double the backslash.Change the line to:
result=name.replace('\\','/')