New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Why can't I output qrcode? #40
Comments
I am unsure of why this is happening. Maybe this is happening because your system's language is Latin a language. I don't use Windows so I unfortunately can't debug this error. |
My ststem language is korean But this doesn't matter in code. We need more examples. |
This is likely affecting all windows boxes, at least it does on mine aswell. It likely has to do with the symbols the qrcode library is sending. I dont believe the windows terminal is UTF-8, therefore UTF-8 specific symbols dont display properly like they do on Mac and Linux. However in testing this I also noticed that outputting to image might also be broken? At least it is for me. @sdushantha I think this might be an issue of the |
@sunrabbit123 @littlediobolic I think I found a solution to this issue. In the beginning of the import colorama
colorama.init() This will emulate support for ANSI escape sequences, which is needed in order to display the QR code. If you don't have
|
Your solution works very sexy. However, it would be better to write the phrase in generate_qr_code rather than main. ex: def generate_qr_code(ssid, password, image=False):
# Source: https://git.io/JtLIv
text = f"WIFI:T:WPA;S:{ssid};P:{password};;"
qr = qrcode.QRCode(version=2,
error_correction=qrcode.constants.ERROR_CORRECT_L,
box_size=10,
border=4)
qr.add_data(text)
if image:
file_name = ssid.replace(" ", "_") + ".png"
img = qr.make_image()
img.save(file_name)
print(f"QR code has been saved to {file_name}")
os.system(file_name)
else:
import colorama
colorama.init()
qr.make()
qr.print_tty() |
This issue has been fixed in a4cbf0d |
Why not I get qrcode image?
I get only Unknown String
What is ploblem?
my
OS
isWindows 10
my python version is
3.9.0
my
wifi-password
version is1.0.7
The text was updated successfully, but these errors were encountered: