You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm @tiangolo or he asked me directly to create an issue here.
Issue Content
I have a code snippet like the next:
importqrcodefromappimportappfromtyperimportOptionfromtyping_extensionsimportAnnotated@app.command()defwifiqr(
password: Annotated[
str, Option(prompt=True, confirmation_prompt=True, hide_input=True, help="The password of the network.")
],
ssid: str=Option(..., help="The SSID of the network."),
encryption: str=Option("WPA", help="The encryption type of the network."),
hidden: bool=Option(False, help="Whether the network is hidden."),
ascii: bool=Option(False, help="Print the QR code as ASCII in terminal, otherwise an image will be saved."),
) ->None:
""" Generate a QR code for a WiFi network. The QR code will contain the SSID, password, encryption, and hidden status. Args: - ssid (str): The SSID of the network. - password (str): The password of the network. - encryption (str): The encryption type of the network. - hidden (bool): Whether the network is hidden. """wifi_data=f"WIFI:S:{ssid};T:{encryption};P:{password};H:{int(hidden)};;"qr=qrcode.QRCode()
qr.add_data(wifi_data)
qr.make()
ifascii:
qr.print_ascii(invert=True)
else:
qr.make_image(fill_color="black", back_color="white").save("wifi.png")
But it pops up the next error:
The text was updated successfully, but these errors were encountered:
Privileged issue
Issue Content
I have a code snippet like the next:
But it pops up the next error:
The text was updated successfully, but these errors were encountered: