python注释SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes: truncated \UXX escape

python program as follows

"""
if __name__ == "__main__":
    
    # 支持文件夹批量导入
    folder = 'tmp' 
    #pathname = os.path.join(os.path.abspath('.'), folder)
    
    # 也支持单个文件的转换
    pathname = r'C:\Users\caiml\Desktop\PPT模板\创意活力\答辩PPT模板1.pptx'

    pdfConverter = PDFConverter(pathname)
    pdfConverter.run_conver()
"""

This program has been annotated, but the error is still running

SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes in position 5085-5086: truncated \UXXXXXXXX escape

solution:

The program

pathname = r'C:\Users\caiml\Desktop\PPT模板\创意活力\答辩PPT模板1.pptx'

Changed

pathname = r'C:\\Users\\caiml\\Desktop\\PPT模板\\创意活力\\答辩PPT模板1.pptx'

 

Published 24 original articles · won praise 30 · views 50000 +

Guess you like

Origin blog.csdn.net/yufen9987/article/details/91572305