Devops

Bienvenue!

This community is for professionals and enthusiasts of our products and services.
Share and discuss the best content and new marketing ideas, build your professional profile and become a better marketer together.

0

Petit exercice Python

Avatar
Sébastien COURATIN


Afin de réaliser un portail d'accueil dans une salle de cours et donner le mot de passe Wifi par un QrCode lisible depuis un Smartphone...

Propose un script en python3.9 pour générer une page html indépendante qui génère cette page avec une commande  python3.9

nomdufichier.py Sesame OuvreToi

N'hesytez à poser des questions... petit indice


python3.9 pip install image qrcode



1 Commentaires
Avatar
Annuler
Avatar
Alexis FREDRIKSEN
-

Bonjour,

Je voulais savoir si j’ai bien compris la consigne.

Quand j’exécute le script python, ça nous renvoie vers une page html qui cette page html affiche le QR code et quand on scanne le QR code sur notre téléphone les informations réseau s’affiche en texte.

Et tout ça juste avec le script.

C’est bien ça ?

1 Réponse
0
Avatar
Sébastien COURATIN
Meilleure réponse

voici le code html par exemple :

<!DOCTYPE html>
<html lang="fr">
<meta charset="UTF-8">
<title>configuration du réseau WiFi Sesame</title>
<meta name="viewportcontent="width=device-width,initial-scale=1">
<link rel="stylesheethref="">
<style>
html, body {
    height: 100%;
    margin: 0;
    padding: 0;
}

.qcode {
    padding: 0;
    display: block;
    margin: 0 auto;
    max-height: 50vh;
    max-width: 50%;
    height: auto;
}

.centered {
    text-align: center;
    font-size: x-large;
}

.monospace {
    font-family: monospace;
}
</style>
<body>
<br><br><br>
<img class="qcodesrc="data:image/png;base64, iVBORw0KGgoAAAANSUhEUgAAAXIAAAFyAQAAAADAX2ykAAAC/0lEQVR4nO2bTY7bMAxGHysBWcpADjBHkW/QM/VIvYF1lBxgAHkZQAa7kGQnmwymzWRslFwk/nmLDyBIkZQsymcs/fgUDsYbb/yX8rM0G1lku+1Xnv7ev0aP8U/mnaqqKuDWbO0UgiqEAlFVVfOr9Bj/bL4FJ4vIiFOiXoU0gOrFUyN5fKEe47+ODwXS0CJZxlC+WY/xT+Pnk5KGRYgXEeLFf7Me4/+Zry5sy24oEH97ILQnynwu7XZ+hR7jn88va8HsoZZWs0dGqD8kEREZXqXH+Ofx6I1lqFVz1AJrEX1j0970G/+BtdYo9P4oqqpOoaCqherzmJ3595i8p66ws6BpbA8lZlTAqbSV+Cr6Gj3GP5fnJjWvYdqycgadcFpfTDiL38PxqOYtK2uNUp1orq3+rc+C5efj8fQwpY4hW5OUm+M3J9v6e0i+jzDCu1dYPHFa0DS4AixCzIMoIUMaXdmffuM/sJv6OWbWvQRXi+geyX2dtvg9GN/9i2vr77oS1/6opebSqi/z78H41h/FqXZFaBry+tKpAAgh16v96Tf+A2th2sdUdXQVt2d5rZ+tPzomP5+UeBGRcRbRX3LSPokGWpEFtbDeo37jH1mrm1g74UyP3zquLK1TsvrqiPy9V7U7VFs53aYavfoy/x6N98BSaydNQ0aZz0r6mSENALMvEhUkXrz1v4fje6z20VXrhXrOBu6GWBa/B+PXbUB3l4b7rkIbd9j+71F5egfk1l192JbeW878e0x+3cuftvM5AMwi1NPR2SnJzrcfk7/5fsEpMbdyq1rMICOLtOjeoX7jH5gHXE3LUicYQSG99RhOg0OZXZHK7U2/8Y+tzqlkdXK9jRdfJOZzIY2LAO5Veox/Ln93hH0e6r/CVUhvVyHmAWU+99NZe9Nv/F/wInLSVm6FgozhauvvMfn77xeUbbsQQkbAKWnI2s5Z7k2/8Y/tZj4JLF5rkTWfixAWTxrePTGvL/am3/jH5rdvjVhbX4WC0uL67sPgvek33vj/mf8D9VJHnwU8gE0AAAAASUVORK5CYII=alt="QRCodestyle="width:100%">
<div class="centered">
 <p>réseau :</p><p class="monospace">Sesame</p>
 <p>mot de passe :</p><p class="monospace">OuvresToi!</p>
</div>
</body>
</html>


Avatar
Annuler