如何在python中写\
当我编写此代码时:
loc = os.path.abspath(os.path.dirname(__file__)) + '\pics' + '\' + file_name
我遇到此错误:
File ".\main.py", line 7
loc = os.path.abspath(os.path.dirname(__file__)) + '\pics' + '\' + file_name
^
SyntaxError: EOL while scanning string literal
loc = os.path.abspath(os.path.dirname(__file__)) + '\pics' + '\' + str(filename)