Created
April 14, 2020 08:09
-
-
Save dunossauro/e5a7ba24eab4c1ad908a6e73e9cf5e25 to your computer and use it in GitHub Desktop.
Código do vídeo sobre Brython - https://youtu.be/HKSUPdcK7OU
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from browser import document | |
from browser.html import INPUT, LABEL, BR, FORM | |
def login_form(): | |
form = FORM( | |
Class='form login-form', | |
id="meu-forme", | |
action="#", | |
method="get", | |
target="_blank", | |
) | |
form <= LABEL('seu nome', For='nome', name="nome") | |
form <= INPUT(id='nome') | |
form <= BR() | |
form <= LABEL('sua senha', For='senha') | |
form <= INPUT(id='senha', type='password', name="senha", required=True) | |
form <= BR() | |
form <= INPUT(id='submit', type='submit') | |
document <= form | |
# return form |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en" dir="ltr"> | |
<head> | |
<meta charset="utf-8"> | |
<title></title> | |
<script type="text/javascript" | |
src="https://cdn.jsdelivr.net/npm/[email protected]/brython.min.js"> | |
</script> | |
</head> | |
<body onload="brython()"> | |
<script type="text/python"> | |
from browser import document | |
from browser.html import H1 | |
from login_form import login_form | |
document <= H1('Boas vindas ao meu login') | |
login_form() | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment