-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPyScript_General-tutorial_1312014268727689226.html
More file actions
38 lines (32 loc) · 30.6 KB
/
PyScript_General-tutorial_1312014268727689226.html
File metadata and controls
38 lines (32 loc) · 30.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
<!DOCTYPE html>
<html lang="en"><head><title>PyScript 💻 - tutorial</title><meta charset="utf-8"/><meta content="width=device-width" name="viewport"/><style>@font-face{src:url("https://cdn.jsdelivr.net/gh/Tyrrrz/DiscordFonts@master/ggsans-normal-400.woff2");font-family:gg sans;font-weight:400;font-style:normal}@font-face{src:url("https://cdn.jsdelivr.net/gh/Tyrrrz/DiscordFonts@master/ggsans-normal-500.woff2");font-family:gg sans;font-weight:500;font-style:normal}@font-face{src:url("https://cdn.jsdelivr.net/gh/Tyrrrz/DiscordFonts@master/ggsans-normal-600.woff2");font-family:gg sans;font-weight:600;font-style:normal}@font-face{src:url("https://cdn.jsdelivr.net/gh/Tyrrrz/DiscordFonts@master/ggsans-normal-700.woff2");font-family:gg sans;font-weight:700;font-style:normal}@font-face{src:url("https://cdn.jsdelivr.net/gh/Tyrrrz/DiscordFonts@master/ggsans-normal-800.woff2");font-family:gg sans;font-weight:800;font-style:normal}@font-face{src:url("https://cdn.jsdelivr.net/gh/Tyrrrz/DiscordFonts@master/ggsans-italic-400.woff2");font-family:gg sans;font-weight:400;font-style:italic}@font-face{src:url("https://cdn.jsdelivr.net/gh/Tyrrrz/DiscordFonts@master/ggsans-italic-500.woff2");font-family:gg sans;font-weight:500;font-style:italic}@font-face{src:url("https://cdn.jsdelivr.net/gh/Tyrrrz/DiscordFonts@master/ggsans-italic-600.woff2");font-family:gg sans;font-weight:600;font-style:italic}@font-face{src:url("https://cdn.jsdelivr.net/gh/Tyrrrz/DiscordFonts@master/ggsans-italic-700.woff2");font-family:gg sans;font-weight:700;font-style:italic}@font-face{src:url("https://cdn.jsdelivr.net/gh/Tyrrrz/DiscordFonts@master/ggsans-italic-800.woff2");font-family:gg sans;font-weight:800;font-style:italic}html,body{margin:0;padding:0;background-color:#ffffff;color:#23262a;font-family:"gg sans","Helvetica Neue",Helvetica,Arial,sans-serif;font-size:17px;font-weight:500;scroll-behavior:smooth}a{color:#0068e0;text-decoration:none}a:hover{text-decoration:underline}img{object-fit:contain;image-rendering:high-quality;image-rendering:-webkit-optimize-contrast}.preamble{display:grid;grid-template-columns:auto 1fr;max-width:100%;padding:1rem}.preamble__guild-icon-container{grid-column:1}.preamble__guild-icon{max-width:88px;max-height:88px}.preamble__entries-container{grid-column:2;margin-left:1rem}.preamble__entry{margin-bottom:0.15rem;color:#2f3136;font-size:1.4rem}.preamble__entry--small{font-size:1rem}.chatlog{padding:1rem 0;width:100%;border-top:1px solid #eceeef;border-bottom:1px solid #eceeef}.chatlog__message-group{margin-bottom:1rem}.chatlog__message-container{background-color:transparent;transition:background-color 1s ease}.chatlog__message-container--highlighted{background-color:rgba(114,137,218,0.2)}.chatlog__message-container--pinned{background-color:rgba(249,168,37,0.05)}.chatlog__message{display:grid;grid-template-columns:auto 1fr;padding:0.15rem 0;direction:ltr;unicode-bidi:bidi-override}.chatlog__message:hover{background-color:#fafafa}.chatlog__message:hover .chatlog__short-timestamp{display:block}.chatlog__message-aside{grid-column:1;width:72px;padding:0.15rem 0.15rem 0 0.15rem;text-align:center}.chatlog__reply-symbol{height:10px;margin:6px 4px 4px 36px;border-left:2px solid #c7ccd1;border-top:2px solid #c7ccd1;border-radius:8px 0 0 0}.chatlog__avatar{width:40px;height:40px;border-radius:50%}.chatlog__short-timestamp{display:none;color:#5e6772;font-size:0.75rem;font-weight:500;direction:ltr;unicode-bidi:bidi-override}.chatlog__message-primary{grid-column:2;min-width:0}.chatlog__reply{display:flex;margin-bottom:0.15rem;align-items:center;color:#5f5f60;font-size:0.875rem;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.chatlog__reply-avatar{width:16px;height:16px;margin-right:0.25rem;border-radius:50%}.chatlog__reply-author{margin-right:0.3rem;font-weight:600}.chatlog__reply-content{overflow:hidden;text-overflow:ellipsis}.chatlog__reply-link{cursor:pointer}.chatlog__reply-link *{display:inline;pointer-events:none}.chatlog__reply-link .chatlog__markdown-quote{display:inline}.chatlog__reply-link .chatlog__markdown-pre{display:inline}.chatlog__reply-link:hover{color:#2f3136}.chatlog__reply-link:hover *:not(.chatlog__markdown-spoiler){color:inherit}.chatlog__reply-edited-timestamp{margin-left:0.25rem;color:#5e6772;font-size:0.75rem;font-weight:500;direction:ltr;unicode-bidi:bidi-override}.chatlog__system-notification-icon{width:18px;height:18px}.chatlog__system-notification-author{font-weight:600;color:#2f3136}.chatlog__system-notification-content{color:#5e6772}.chatlog__system-notification-link{font-weight:500;color:#2f3136}.chatlog__system-notification-timestamp{margin-left:0.3rem;color:#5e6772;font-size:0.75rem;font-weight:500;direction:ltr;unicode-bidi:bidi-override}.chatlog__system-notification-timestamp a{color:inherit}.chatlog__header{margin-bottom:0.1rem}.chatlog__author{font-weight:600;color:#2f3136}.chatlog__author-tag{position:relative;top:-0.1rem;margin-left:0.3rem;padding:0.05rem 0.3rem;border-radius:3px;background-color:#5865F2;color:#ffffff;font-size:0.625rem;font-weight:500;line-height:1.3}.chatlog__timestamp{margin-left:0.3rem;color:#5e6772;font-size:0.75rem;font-weight:500;direction:ltr;unicode-bidi:bidi-override}.chatlog__timestamp a{color:inherit}.chatlog__content{padding-right:1rem;font-size:0.95rem;word-wrap:break-word}.chatlog__edited-timestamp{margin-left:0.15rem;color:#5e6772;font-size:0.75rem;font-weight:500}.chatlog__attachment{position:relative;width:fit-content;margin-top:0.3rem;border-radius:3px;overflow:hidden}.chatlog__attachment--hidden{cursor:pointer;box-shadow:0 0 1px 1px rgba(0,0,0,0.1)}.chatlog__attachment--hidden *{pointer-events:none}.chatlog__attachment-spoiler-caption{display:none;position:absolute;left:50%;top:50%;z-index:999;padding:0.4rem 0.8rem;border-radius:20px;transform:translate(-50%,-50%);background-color:rgba(0,0,0,0.9);color:#dcddde;font-size:0.9rem;font-weight:600;letter-spacing:0.05rem}.chatlog__attachment--hidden .chatlog__attachment-spoiler-caption{display:block}.chatlog__attachment--hidden:hover .chatlog__attachment-spoiler-caption{color:#fff}.chatlog__attachment-media{max-width:45vw;max-height:500px;vertical-align:top;border-radius:3px}.chatlog__attachment--hidden .chatlog__attachment-media{filter:blur(44px)}.chatlog__attachment-generic{max-width:520px;width:100%;height:40px;padding:10px;border:1px solid #ebedef;border-radius:3px;background-color:#f2f3f5;overflow:hidden}.chatlog__attachment--hidden .chatlog__attachment-generic{filter:blur(44px)}.chatlog__attachment-generic-icon{float:left;width:30px;height:100%;margin-right:10px}.chatlog__attachment-generic-size{color:#72767d;font-size:12px}.chatlog__attachment-generic-name{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.chatlog__embed{display:flex;margin-top:0.3rem;max-width:520px}.chatlog__embed-color-pill{flex-shrink:0;width:0.25rem;border-top-left-radius:3px;border-bottom-left-radius:3px}.chatlog__embed-color-pill--default{background-color:rgba(227,229,232,1)}.chatlog__embed-content-container{display:flex;flex-direction:column;padding:0.5rem 0.6rem;border:1px solid rgba(204,204,204,0.3);border-top-right-radius:3px;border-bottom-right-radius:3px;background-color:rgba(249,249,249,0.3)}.chatlog__embed-content{display:flex;width:100%}.chatlog__embed-text{flex:1}.chatlog__embed-author-container{display:flex;margin-bottom:0.5rem;align-items:center}.chatlog__embed-author-icon{width:20px;height:20px;margin-right:0.5rem;border-radius:50%}.chatlog__embed-author{color:#4f545c;font-size:0.875rem;font-weight:600;direction:ltr;unicode-bidi:bidi-override}.chatlog__embed-author-link{color:#4f545c}.chatlog__embed-title{margin-bottom:0.5rem;color:#4f545c;font-size:0.875rem;font-weight:600}.chatlog__embed-description{color:#2e3338;font-weight:500;font-size:0.85rem}.chatlog__embed-fields{display:flex;flex-wrap:wrap;gap:0 0.5rem}.chatlog__embed-field{flex:0;min-width:100%;max-width:506px;padding-top:0.6rem;font-size:0.875rem}.chatlog__embed-field--inline{flex:1;flex-basis:auto;min-width:50px}.chatlog__embed-field-name{margin-bottom:0.2rem;color:#36393e;font-weight:600}.chatlog__embed-field-value{color:#2e3338;font-weight:500}.chatlog__embed-thumbnail{flex:0;max-width:80px;max-height:80px;margin-left:1.2rem;border-radius:3px}.chatlog__embed-images{display:grid;margin-top:0.6rem;grid-template-columns:repeat(2,1fr);gap:0.25rem}.chatlog__embed-images--single{display:block}.chatlog__embed-image{object-fit:cover;object-position:center;max-width:500px;max-height:400px;width:100%;height:100%;border-radius:3px}.chatlog__embed-footer{margin-top:0.6rem;color:#2e3338}.chatlog__embed-footer-icon{width:20px;height:20px;margin-right:0.2rem;border-radius:50%;vertical-align:middle}.chatlog__embed-footer-text{vertical-align:middle;font-size:0.75rem;font-weight:500}.chatlog__embed-invite-container{min-width:320px;padding:0.6rem 0.7rem;border:1px solid rgba(204,204,204,0.3);border-radius:3px;background-color:rgba(249,249,249,0.3)}.chatlog__embed-invite-title{margin:0 0 0.8rem 0;color:#4f5660;font-size:0.75rem;font-weight:700;text-transform:uppercase}.chatlog__embed-invite{display:flex}.chatlog__embed-invite-guild-icon{width:50px;height:50px;border-radius:0.85rem}.chatlog__embed-invite-info{margin-left:1rem}.chatlog__embed-invite-guild-name{color:#36393e;font-weight:600}.chatlog__embed-invite-guild-name a{color:inherit}.chatlog__embed-invite-channel-icon{width:18px;height:18px;vertical-align:bottom}.chatlog__embed-invite-channel-name{font-size:0.9rem;font-weight:600}.chatlog__embed-generic-image{object-fit:contain;object-position:left;max-width:45vw;max-height:500px;vertical-align:top;border-radius:3px}.chatlog__embed-generic-video{object-fit:contain;object-position:left;max-width:45vw;max-height:500px;vertical-align:top;border-radius:3px}.chatlog__embed-generic-gifv{object-fit:contain;object-position:left;max-width:45vw;max-height:500px;vertical-align:top;border-radius:3px}.chatlog__embed-spotify{border:0}.chatlog__embed-twitch{border:0}.chatlog__embed-youtube-container{margin-top:0.6rem}.chatlog__embed-youtube{border:0;border-radius:3px}.chatlog__sticker{width:180px;height:180px}.chatlog__sticker--media{max-width:100%;max-height:100%}.chatlog__reactions{display:flex}.chatlog__reaction{display:flex;margin:0.35rem 0.1rem 0.1rem 0;padding:0.125rem 0.375rem;border:1px solid transparent;border-radius:8px;background-color:#f2f3f5;align-items:center}.chatlog__reaction:hover{border:1px solid rgba(0,0,0,0.2);background-color:white}.chatlog__reaction-count{min-width:9px;margin-left:0.35rem;color:#4f5660;font-size:0.875rem}.chatlog__reaction:hover .chatlog__reaction-count{color:#2e3338}.chatlog__markdown{max-width:100%;line-height:1.3;overflow-wrap:break-word}.chatlog__markdown h1{margin:1rem 0 0.5rem;color:#060607;font-size:1.5rem;line-height:1}.chatlog__markdown h2{margin:1rem 0 0.5rem;color:#060607;font-size:1.25rem;line-height:1}.chatlog__markdown h3{margin:1rem 0 0.5rem;color:#060607;font-size:1rem;line-height:1}.chatlog__markdown h1:first-child,h2:first-child,h3:first-child{margin-top:0.5rem}.chatlog__markdown ul,ol{margin:0 0 0 1rem;padding:0}.chatlog__markdown-preserve{white-space:pre-wrap}.chatlog__markdown-spoiler{background-color:rgba(0,0,0,0.1);padding:0 2px;border-radius:3px}.chatlog__markdown-spoiler--hidden{cursor:pointer;background-color:#b9bbbe;color:rgba(0,0,0,0)}.chatlog__markdown-spoiler--hidden:hover{background-color:rgba(185,187,190,0.8)}.chatlog__markdown-spoiler--hidden::selection{color:rgba(0,0,0,0)}.chatlog__markdown-quote{display:flex;margin:0.05rem 0}.chatlog__markdown-quote-border{margin-right:0.5rem;border:2px solid #c7ccd1;border-radius:3px}.chatlog__markdown-pre{background-color:#f9f9f9;font-family:"Consolas","Courier New",Courier,monospace;font-size:0.85rem;text-decoration:inherit}.chatlog__markdown-pre--multiline{display:block;margin-top:0.25rem;padding:0.5rem;border:2px solid #f3f3f3;border-radius:5px;color:#657b83}.chatlog__markdown-pre--multiline.hljs{background-color:#f9f9f9;color:#657b83}.chatlog__markdown-pre--inline{display:inline-block;padding:2px;border-radius:3px}.chatlog__markdown-mention{border-radius:3px;padding:0 2px;background-color:rgba(88,101,242,.15);color:#505cdc;font-weight:500}.chatlog__markdown-mention:hover{background-color:#5865f2;color:#ffffff}.chatlog__markdown-timestamp{background-color:rgba(0,0,0,0.1);padding:0 2px;border-radius:3px}.chatlog__emoji{width:1.325rem;height:1.325rem;margin:0 0.06rem;vertical-align:-0.4rem}.chatlog__emoji--small{width:1rem;height:1rem}.chatlog__emoji--large{width:2.8rem;height:2.8rem}.postamble{padding:1.25rem}.postamble__entry{color:#2f3136}</style><link href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.15.6/styles/solarized-light.min.css" rel="stylesheet"/><script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.15.6/highlight.min.js"></script><script>document.addEventListener('DOMContentLoaded',()=>{document.querySelectorAll('.chatlog__markdown-pre--multiline').forEach(e=>hljs.highlightBlock(e));});</script><script src="https://cdnjs.cloudflare.com/ajax/libs/lottie-web/5.8.1/lottie.min.js"></script><script>document.addEventListener('DOMContentLoaded',()=>{document.querySelectorAll('.chatlog__sticker--media[data-source]').forEach(e=>{const anim=lottie.loadAnimation({container:e,renderer:'svg',loop:true,autoplay:true,path:e.getAttribute('data-source')});anim.addEventListener('data_failed',()=>e.innerHTML='<strong>[Sticker cannot be rendered]</strong>');});});</script><script>function scrollToMessage(event,id){const element=document.getElementById('chatlog__message-container-'+id);if(!element)
return;event.preventDefault();element.classList.add('chatlog__message-container--highlighted');window.scrollTo({top:element.getBoundingClientRect().top-document.body.getBoundingClientRect().top-(window.innerHeight/2),behavior:'smooth'});window.setTimeout(()=>element.classList.remove('chatlog__message-container--highlighted'),2000);}
function showSpoiler(event,element){if(!element)
return;if(element.classList.contains('chatlog__attachment--hidden')){event.preventDefault();element.classList.remove('chatlog__attachment--hidden');}
if(element.classList.contains('chatlog__markdown-spoiler--hidden')){event.preventDefault();element.classList.remove('chatlog__markdown-spoiler--hidden');}}</script><svg style="display:none" xmlns="http://www.w3.org/2000/svg"><defs><symbol id="attachment-icon" viewbox="0 0 720 960"><path d="M50,935a25,25,0,0,1-25-25V50A25,25,0,0,1,50,25H519.6L695,201.32V910a25,25,0,0,1-25,25Z" fill="#f4f5fb"></path><path d="M509.21,50,670,211.63V910H50V50H509.21M530,0H50A50,50,0,0,0,0,50V910a50,50,0,0,0,50,50H670a50,50,0,0,0,50-50h0V191Z" fill="#7789c4"></path><path d="M530,215a25,25,0,0,1-25-25V50a25,25,0,0,1,16.23-23.41L693.41,198.77A25,25,0,0,1,670,215Z" fill="#f4f5fb"></path><path d="M530,70.71,649.29,190H530V70.71M530,0a50,50,0,0,0-50,50V190a50,50,0,0,0,50,50H670a50,50,0,0,0,50-50Z" fill="#7789c4"></path></symbol><symbol id="join-icon" viewbox="0 0 18 18"><path d="m0 8h14.2l-3.6-3.6 1.4-1.4 6 6-6 6-1.4-1.4 3.6-3.6h-14.2" fill="#3ba55c"></path></symbol><symbol id="leave-icon" viewbox="0 0 18 18"><path d="m3.8 8 3.6-3.6-1.4-1.4-6 6 6 6 1.4-1.4-3.6-3.6h14.2v-2" fill="#ed4245"></path></symbol><symbol id="call-icon" viewbox="0 0 18 18"><path d="M17.7163041 15.36645368c-.0190957.02699568-1.9039523 2.6680735-2.9957762 2.63320406-3.0676659-.09785935-6.6733809-3.07188394-9.15694343-5.548738C3.08002193 9.9740657.09772497 6.3791404 0 3.3061316v-.024746C0 2.2060575 2.61386252.3152347 2.64082114.2972376c.7110335-.4971705 1.4917101-.3149497 1.80959713.1372281.19320342.2744561 2.19712724 3.2811005 2.42290565 3.6489167.09884826.1608492.14714912.3554431.14714912.5702838 0 .2744561-.07975258.5770327-.23701117.8751101-.1527655.2902036-.65262318 1.1664385-.89862055 1.594995.2673396.3768148.94804468 1.26429792 2.351016 2.66357424 1.39173858 1.39027775 2.28923588 2.07641807 2.67002628 2.34187563.4302146-.2452108 1.3086162-.74238132 1.5972981-.89423205.5447887-.28682915 1.0907006-.31944893 1.4568885-.08661115.3459689.2182151 3.3383754 2.21027167 3.6225641 2.41611376.2695862.19234426.4144887.5399137.4144887.91672846 0 .2969525-.089862.61190215-.2808189.88523346" fill="#3ba55c" fill-rule="evenodd"></path></symbol><symbol id="pencil-icon" viewbox="0 0 18 18"><path d="m0 14.25v3.75h3.75l11.06-11.06-3.75-3.75zm17.71-10.21c.39-.39.39-1.02 0-1.41l-2.34-2.34c-.39-.39-1.02-.39-1.41 0l-1.83 1.83 3.75 3.75z" fill="#99aab5"></path></symbol><symbol id="pin-icon" viewbox="0 0 18 18"><path d="m16.908 8.39684-8.29587-8.295827-1.18584 1.184157 1.18584 1.18584-4.14834 4.1475v.00167l-1.18583-1.18583-1.185 1.18583 3.55583 3.55502-4.740831 4.74 1.185001 1.185 4.74083-4.74 3.55581 3.555 1.185-1.185-1.185-1.185 4.1475-4.14836h.0009l1.185 1.185z" fill="#b9bbbe"></path></symbol><symbol id="channel-icon" viewbox="0 0 24 24"><path d="M5.88657 21C5.57547 21 5.3399 20.7189 5.39427 20.4126L6.00001 17H2.59511C2.28449 17 2.04905 16.7198 2.10259 16.4138L2.27759 15.4138C2.31946 15.1746 2.52722 15 2.77011 15H6.35001L7.41001 9H4.00511C3.69449 9 3.45905 8.71977 3.51259 8.41381L3.68759 7.41381C3.72946 7.17456 3.93722 7 4.18011 7H7.76001L8.39677 3.41262C8.43914 3.17391 8.64664 3 8.88907 3H9.87344C10.1845 3 10.4201 3.28107 10.3657 3.58738L9.76001 7H15.76L16.3968 3.41262C16.4391 3.17391 16.6466 3 16.8891 3H17.8734C18.1845 3 18.4201 3.28107 18.3657 3.58738L17.76 7H21.1649C21.4755 7 21.711 7.28023 21.6574 7.58619L21.4824 8.58619C21.4406 8.82544 21.2328 9 20.9899 9H17.41L16.35 15H19.7549C20.0655 15 20.301 15.2802 20.2474 15.5862L20.0724 16.5862C20.0306 16.8254 19.8228 17 19.5799 17H16L15.3632 20.5874C15.3209 20.8261 15.1134 21 14.8709 21H13.8866C13.5755 21 13.3399 20.7189 13.3943 20.4126L14 17H8.00001L7.36325 20.5874C7.32088 20.8261 7.11337 21 6.87094 21H5.88657ZM9.41045 9L8.35045 15H14.3504L15.4104 9H9.41045Z" fill="#b9bbbe"></path></symbol><symbol id="thread-icon" viewbox="0 0 24 24"><path d="M5.43309 21C5.35842 21 5.30189 20.9325 5.31494 20.859L5.99991 17H2.14274C2.06819 17 2.01168 16.9327 2.02453 16.8593L2.33253 15.0993C2.34258 15.0419 2.39244 15 2.45074 15H6.34991L7.40991 9H3.55274C3.47819 9 3.42168 8.93274 3.43453 8.85931L3.74253 7.09931C3.75258 7.04189 3.80244 7 3.86074 7H7.75991L8.45234 3.09903C8.46251 3.04174 8.51231 3 8.57049 3H10.3267C10.4014 3 10.4579 3.06746 10.4449 3.14097L9.75991 7H15.7599L16.4523 3.09903C16.4625 3.04174 16.5123 3 16.5705 3H18.3267C18.4014 3 18.4579 3.06746 18.4449 3.14097L17.7599 7H21.6171C21.6916 7 21.7481 7.06725 21.7353 7.14069L21.4273 8.90069C21.4172 8.95811 21.3674 9 21.3091 9H17.4099L17.0495 11.04H15.05L15.4104 9H9.41035L8.35035 15H10.5599V17H7.99991L7.30749 20.901C7.29732 20.9583 7.24752 21 7.18934 21H5.43309Z" fill="#b9bbbe"></path><path d="M13.4399 12.96C12.9097 12.96 12.4799 13.3898 12.4799 13.92V20.2213C12.4799 20.7515 12.9097 21.1813 13.4399 21.1813H14.3999C14.5325 21.1813 14.6399 21.2887 14.6399 21.4213V23.4597C14.6399 23.6677 14.8865 23.7773 15.0408 23.6378L17.4858 21.4289C17.6622 21.2695 17.8916 21.1813 18.1294 21.1813H22.5599C23.0901 21.1813 23.5199 20.7515 23.5199 20.2213V13.92C23.5199 13.3898 23.0901 12.96 22.5599 12.96H13.4399Z" fill="#b9bbbe"></path></symbol></defs></svg><body><div class="preamble"><div class="preamble__guild-icon-container"><img alt="Guild icon" class="preamble__guild-icon" loading="lazy" src="assets/eef8bb9f6c6a6b82d7a65bb77f8b5e94.png"/></div><div class="preamble__entries-container"><div class="preamble__entry">PyScript 💻</div><div class="preamble__entry">💬 | General / tutorial</div><div class="preamble__entry preamble__entry--small">This channel is for questions and live chat during PyScript related tutorials taking place online or in-person at conferences.</div></div></div>
<div class="chatlog">
<div class="chatlog__message-group"><div class="chatlog__message-container" data-message-id="1312014648899407963" id="chatlog__message-container-1312014648899407963"><div class="chatlog__message"><div class="chatlog__message-aside"><img alt="Avatar" class="chatlog__avatar" loading="lazy" src="assets/1f047e7d4848bad8f0a3362947e3eb03.png"/></div><div class="chatlog__message-primary"><div class="chatlog__header"><span class="chatlog__author" data-user-id="354682505271443468" style="color:rgb(233,102,11)" title="ntoll">ntoll</span> <span class="chatlog__timestamp" title="29 November 2024 11:17"><a href="#chatlog__message-container-1312014648899407963">29/11/2024 11:17</a></span></div><div class="chatlog__content chatlog__markdown"><span class="chatlog__markdown-preserve">Hi there! Welcome. <img alt="👋" class="chatlog__emoji" loading="lazy" src="https://cdn.jsdelivr.net/gh/twitter/twemoji@latest/assets/svg/1f44b.svg" title="wave"/></span></div></div></div></div></div>
<div class="chatlog__message-group"><div class="chatlog__message-container" data-message-id="1332159218924392580" id="chatlog__message-container-1332159218924392580"><div class="chatlog__message"><div class="chatlog__message-aside"><img alt="Avatar" class="chatlog__avatar" loading="lazy" src="assets/664add6a8414c9557c323c2c2997b587.png"/></div><div class="chatlog__message-primary"><div class="chatlog__header"><span class="chatlog__author" data-user-id="741922704906649630" title="kelantan">Robust general</span> <span class="chatlog__timestamp" title="24 January 2025 01:25"><a href="#chatlog__message-container-1332159218924392580">24/01/2025 01:25</a></span></div><div class="chatlog__content chatlog__markdown"><span class="chatlog__markdown-preserve">Coding QR Code generator with Python</span></div><div class="chatlog__attachment"><video class="chatlog__attachment-media" controls=""><source alt="Video attachment" src="https://cdn.discordapp.com/attachments/1312014268727689226/1332159218643370035/Creating_a_basic_QR_Code_generator_with_Python.mp4?ex=691bcaf4&is=691a7974&hm=b6eb12f9f228f044c05c7c090a8dfc0be08774de34c04585fe2a68c00f5af156&" title="Video: Creating_a_basic_QR_Code_generator_with_Python.mp4 (1.19 MB)"/></video></div><div class="chatlog__reactions"><div class="chatlog__reaction" title="thumbsup"><img alt="👍" class="chatlog__emoji chatlog__emoji--small" loading="lazy" src="https://cdn.jsdelivr.net/gh/twitter/twemoji@latest/assets/svg/1f44d.svg"/> <span class="chatlog__reaction-count">1</span></div></div></div></div></div></div>
<div class="chatlog__message-group"><div class="chatlog__message-container" data-message-id="1332300564146556978" id="chatlog__message-container-1332300564146556978"><div class="chatlog__message"><div class="chatlog__message-aside"><img alt="Avatar" class="chatlog__avatar" loading="lazy" src="assets/1f047e7d4848bad8f0a3362947e3eb03.png"/></div><div class="chatlog__message-primary"><div class="chatlog__header"><span class="chatlog__author" data-user-id="354682505271443468" style="color:rgb(233,102,11)" title="ntoll">ntoll</span> <span class="chatlog__timestamp" title="24 January 2025 10:46"><a href="#chatlog__message-container-1332300564146556978">24/01/2025 10:46</a></span></div><div class="chatlog__content chatlog__markdown"><span class="chatlog__markdown-preserve">Nice one <span class="chatlog__markdown-mention" title="kelantan">@Robust general</span> - but can you make it work in PyScript..? <img alt="😉" class="chatlog__emoji" loading="lazy" src="https://cdn.jsdelivr.net/gh/twitter/twemoji@latest/assets/svg/1f609.svg" title="wink"/></span></div></div></div></div></div>
<div class="chatlog__message-group"><div class="chatlog__message-container" data-message-id="1332323063575871499" id="chatlog__message-container-1332323063575871499"><div class="chatlog__message"><div class="chatlog__message-aside"><img alt="Avatar" class="chatlog__avatar" loading="lazy" src="assets/664add6a8414c9557c323c2c2997b587.png"/></div><div class="chatlog__message-primary"><div class="chatlog__header"><span class="chatlog__author" data-user-id="741922704906649630" title="kelantan">Robust general</span> <span class="chatlog__timestamp" title="24 January 2025 12:16"><a href="#chatlog__message-container-1332323063575871499">24/01/2025 12:16</a></span></div><div class="chatlog__content chatlog__markdown"><span class="chatlog__markdown-preserve">The question is does Pyscript support pyqrcode library?</span></div></div></div></div></div>
<div class="chatlog__message-group"><div class="chatlog__message-container" data-message-id="1332357327860273284" id="chatlog__message-container-1332357327860273284"><div class="chatlog__message"><div class="chatlog__message-aside"><img alt="Avatar" class="chatlog__avatar" loading="lazy" src="assets/1f047e7d4848bad8f0a3362947e3eb03.png"/></div><div class="chatlog__message-primary"><div class="chatlog__header"><span class="chatlog__author" data-user-id="354682505271443468" style="color:rgb(233,102,11)" title="ntoll">ntoll</span> <span class="chatlog__timestamp" title="24 January 2025 14:32"><a href="#chatlog__message-container-1332357327860273284">24/01/2025 14:32</a></span></div><div class="chatlog__content chatlog__markdown"><span class="chatlog__markdown-preserve">There's only one way to find out! <img alt="🙂" class="chatlog__emoji" loading="lazy" src="https://cdn.jsdelivr.net/gh/twitter/twemoji@latest/assets/svg/1f642.svg" title="slight_smile"/></span></div></div></div></div></div>
<div class="chatlog__message-group"><div class="chatlog__message-container" data-message-id="1354205504376930414" id="chatlog__message-container-1354205504376930414"><div class="chatlog__message"><div class="chatlog__message-aside"><img alt="Avatar" class="chatlog__avatar" loading="lazy" src="assets/1.png"/></div><div class="chatlog__message-primary"><div class="chatlog__header"><span class="chatlog__author" data-user-id="780447698347491368" style="color:rgb(26,194,181)" title="mchilvers">Martin</span> <span class="chatlog__timestamp" title="25 March 2025 21:29"><a href="#chatlog__message-container-1354205504376930414">25/03/2025 21:29</a></span></div><div class="chatlog__content chatlog__markdown"><span class="chatlog__markdown-preserve"><a href="https://mchilvers.pyscriptapps.com/qr-code-generator/latest/">https://mchilvers.pyscriptapps.com/qr-code-generator/latest/</a></span></div></div></div></div></div>
<div class="chatlog__message-group"><div class="chatlog__message-container" data-message-id="1355643063787327678" id="chatlog__message-container-1355643063787327678"><div class="chatlog__message"><div class="chatlog__message-aside"><div class="chatlog__reply-symbol"></div><img alt="Avatar" class="chatlog__avatar" loading="lazy" src="assets/d371b9226619916355e6b88faf31b627.png"/></div><div class="chatlog__message-primary"><div class="chatlog__reply"><img alt="Avatar" class="chatlog__reply-avatar" loading="lazy" src="assets/1.png"/><div class="chatlog__reply-author" style="color:rgb(26,194,181)" title="mchilvers">Martin</div><div class="chatlog__reply-content"><span class="chatlog__reply-link" onclick="scrollToMessage(event,'1354205504376930414')"> <a href="https://mchilvers.pyscriptapps.com/qr-code-generator/latest/">https://mchilvers.pyscriptapps.com/qr-code-generator/latest/</a> </span></div></div><div class="chatlog__header"><span class="chatlog__author" data-user-id="1242599857655644164" title="chrislaffra.">Chris Laffra</span> <span class="chatlog__timestamp" title="29 March 2025 20:41"><a href="#chatlog__message-container-1355643063787327678">29/03/2025 20:41</a></span></div><div class="chatlog__content chatlog__markdown"><span class="chatlog__markdown-preserve">It does not look like you generated that project with an AI. Could you? <img alt="🤓" class="chatlog__emoji" loading="lazy" src="https://cdn.jsdelivr.net/gh/twitter/twemoji@latest/assets/svg/1f913.svg" title="nerd"/></span></div></div></div></div></div>
<div class="chatlog__message-group"><div class="chatlog__message-container" data-message-id="1357278877046669353" id="chatlog__message-container-1357278877046669353"><div class="chatlog__message"><div class="chatlog__message-aside"><div class="chatlog__reply-symbol"></div><img alt="Avatar" class="chatlog__avatar" loading="lazy" src="assets/6e3d708f4f9680a9c7bb76a916c623d8.png"/></div><div class="chatlog__message-primary"><div class="chatlog__reply"><img alt="Avatar" class="chatlog__reply-avatar" loading="lazy" src="assets/1.png"/><div class="chatlog__reply-author" style="color:rgb(26,194,181)" title="mchilvers">Martin</div><div class="chatlog__reply-content"><span class="chatlog__reply-link" onclick="scrollToMessage(event,'1354205504376930414')"> <a href="https://mchilvers.pyscriptapps.com/qr-code-generator/latest/">https://mchilvers.pyscriptapps.com/qr-code-generator/latest/</a> </span></div></div><div class="chatlog__header"><span class="chatlog__author" data-user-id="1084780393548480513" style="color:rgb(26,194,181)" title="agiammarchi">Andrea Giammarchi</span> <span class="chatlog__timestamp" title="03 April 2025 10:01"><a href="#chatlog__message-container-1357278877046669353">03/04/2025 10:01</a></span></div><div class="chatlog__content chatlog__markdown"><span class="chatlog__markdown-preserve">I took a slightly different approach: <a href="https://pyscript.com/@agiammarchi/qr-code-generator-copy/latest?files=main.py">https://pyscript.com/@agiammarchi/qr-code-generator-copy/latest?files=main.py</a>
<code class="chatlog__markdown-pre chatlog__markdown-pre--multiline language-python">""" QR Code Generator. """
import segno
from pyscript import document, when
@when('click', '#generate-qr-code-btn')
def on_generate_qr_code_btn_click():
# Generate a 5-H QR code from the content of the text input.
text_input = document.querySelector("#qr-code-input")
qrcode = segno.make(text_input.value, error='h')
# Show the QR code in the target div element.
out = document.querySelector("#qr-code-img")
out.innerHTML = qrcode.svg_inline(scale=5)</code>
that's pretty much it:
<ul><li>images are never blurry, those are vectors</li><li>no need to bother the save + File + URL.createObjectURL dance</li></ul></span> <span class="chatlog__edited-timestamp" title="03 April 2025 10:02">(edited)</span></div></div></div></div></div>
<div class="chatlog__message-group"><div class="chatlog__message-container" data-message-id="1432079573826142339" id="chatlog__message-container-1432079573826142339"><div class="chatlog__message"><div class="chatlog__message-aside"><div class="chatlog__reply-symbol"></div><img alt="Avatar" class="chatlog__avatar" loading="lazy" src="assets/f7f2e9361e8a54ce6e72580ac7b967af.png"/></div><div class="chatlog__message-primary"><div class="chatlog__reply"><div class="chatlog__reply-unknown">Original message was deleted or could not be loaded.</div></div><div class="chatlog__header"><span class="chatlog__author" data-user-id="1398428592098115617" title="maconic_93367">maconic</span> <span class="chatlog__timestamp" title="26 October 2025 18:52"><a href="#chatlog__message-container-1432079573826142339">26/10/2025 18:52</a></span></div><div class="chatlog__content chatlog__markdown"><span class="chatlog__markdown-preserve">Does spam like this actually work? I doubt you'll find any success here.</span></div></div></div></div></div>
</div>
<div class="postamble"><div class="postamble__entry">Exported 9 message(s)</div><div class="postamble__entry">Timezone: UTC+0</div></div>
</body></head></html>