This error is caused by the use of single quotes inside a raw string literal. To fix it, you can either escape the single quotes or use double quotes for the outer string literal. Here's an example:

list = r'error: ~(.*?)~','trace':[{'file':'/www/wwwroot/'}

or

list = r'error: ~(.*?)~','trace':[{'file':'/www/wwwroot/''}

Python SyntaxError: invalid syntax - Raw String Literal Issue

原文地址: https://www.cveoy.top/t/topic/mIWD 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录