QR Code Creation in Python Does Not Work

Asked 1 years ago, Updated 1 years ago, 335 views

I tried to create a QR code according to the site below, but it didn't work.If you know the cause, could you please let me know?
https://web-lh.fromation.co.jp/archives/10000053001

pip install qrcode
Requirement already satified: qrcode inc:\users\user\anaconda3\lib\site-packages(7.3.1)
Requirement already satified: colorama in c:\users\user\anaconda3\lib\site-packages(from qrcode)(0.4.5)
Note: you may need to restart the kernel to use updated packages.
Download
img=qrcode.make('https://www.google.com/?hl=ja')
img.save('[C:\Users\user\Desktop\Meeting].png')
File "C:\Users\user\AppData\Local\Temp\ipykernel_440\2780929148.py", line2
img.save('[C:\Users\user\Desktop\Meeting].png')
^
SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes in position 12-13: truncated\UXXXXXXescape

python qr-code

2023-01-15 15:05

1 Answers

Invalid file specification path. ([] is not required)
Try correcting it as follows:

Modification Examples:

img.save('C:\Users\user\Desktop\Meeting.png')


2023-01-15 15:23

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.