[Python] Asyncio webserver store HTML dropdown option in Python variable

Discussão em 'Python' iniciado por Stack, Março 22, 2025.

  1. Stack

    Stack Membro Participativo

    Im trying to run webserver beneath my main python script on my ESP32. I want to display a HTML dropdown menu on the webserver and store the value in a Python variable.

    Here is a option of this dropdown menu and the submit

    <select name="dropdown" id="dropdown">
    <option value="649">McMiller</option>
    </select>
    <br>
    <form action="./sendToESP">
    <input type="submit" value="Send!" />
    </form>


    From a tutorial i found, that i can call the request with:

    if request == '/sendToESP?':

    but i cant find any information to store the value 649 in a Python variable.

    I tried some variable calls with /sendToESP request but always ended in errors.

    Continue reading...

Compartilhe esta Página