ITADN

line 39 f-string: unmatched '('

#2Openkarl-an 创建于 2024-04-29
K
karl-ancommented
I get this error: File "/content/./pdf2md.py", line 39 f'base64,{base64.b64encode(buffer.getvalue()).decode('utf8')}' ^^^^ SyntaxError: f-string: unmatched '(' The problem is with the use of single quotes inside an f-string, which ends the string prematurely. Here’s the corrected version of the problematic line: `url_encoded_image = ( f'data:image/{page_image.format.lower()};' f'base64,{base64.b64encode(buffer.getvalue()).decode("utf8")}' ) `
0 条评论