You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
1. Getting started with PyScript | Bangla | School of Thought
<!DOCTYPE html><html><head><!-- <link rel="stylesheet" href="https://pyscript.net/alpha/pyscript.css" /> --><scriptdefersrc="https://pyscript.net/alpha/pyscript.js"></script><!-- CSS only --><linkhref="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" rel="stylesheet"
integrity="sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3" crossorigin="anonymous"></head><body><divclass="container"><h1>My First Heading</h1><p>My first paragraph.</p><!-- Magic is here! --><py-scriptclass="text-center"> print('Hello, World!') </py-script><py-script> print('Hello, World!') </py-script><py-script> print('Hello, World!') </py-script></div></body></html>
2. Console and Log using PyScript | Bangla | School of Thought
<!DOCTYPE html><html><head><!-- <link rel="stylesheet" href="https://pyscript.net/alpha/pyscript.css" /> --><scriptdefersrc="https://pyscript.net/alpha/pyscript.js"></script></head><body><h1>Welcome to Python Compiler </h1><p>PyScript is Awesome</p><py-script>
from js import console
console.log("Console Log from PyScript")
console.warn("Console Warn from PyScript")
console.error("Console Error from PyScript")
console.info("Console Info from PyScript")
</py-script></body></html>
3. Simple input and output using PyScript | Bangla | School of Thought
<!DOCTYPE html><html><head><!--<link rel="stylesheet" href="https://pyscript.net/alpha/pyscript.css" />--><scriptdefersrc="https://pyscript.net/alpha/pyscript.js"></script></head><body><div>Type an sample input here</div><inputtype="text" id="test-input"/><buttonid="submit-button" type="submit" pys-onClick="my_function">OK</button><divid="test-output"></div><py-script>
from js import console
def my_function(*args, **kwargs):
#print('args:', args)
#print('kwargs:', kwargs)
console.log(f'args: {args}')
console.log(f'kwargs: {kwargs}')
text = Element('test-input').element.value
#print('text:', text)
console.log(f'text: {text}')
Element('test-output').element.innerText = text
</py-script></body></html>
4. If Else using PyScript | Bangla | School of Thought