File tree Expand file tree Collapse file tree 1 file changed +28
-2
lines changed
Expand file tree Collapse file tree 1 file changed +28
-2
lines changed Original file line number Diff line number Diff line change 33
44<h1 style =" text-align : center ; font-weight : bold ;" >PyScript is an <u >open source</u > platform for Python in the browser.</h1 >
55
6+ ** Step 1:** Add these two lines to the ` <head> ` of your HTML document:
7+
8+ ``` html
9+ <link rel =" stylesheet" href =" https://pyscript.net/releases/2025.11.2/core.css" />
10+ <script type =" module" src =" https://pyscript.net/releases/2025.11.2/core.js" ></script >
11+ ```
12+
13+ ** Step 2:** Start PyScript with a ` <script> ` tag:
14+
15+ ``` html
16+ <script type =" py" config =" ./conf.json" src =" ./main.py" ></script >
17+ ```
18+
19+ ** Step 3:** Write Python (use the ` pyscript ` namespace):
20+
21+ ``` python
22+ from pyscript import when, display
23+
24+
25+ @when (" click" , " #my-button" )
26+ def handler ():
27+ display(" Button clicked!" )
28+ ```
29+
30+ That's just the start of it!
31+
32+ What's next?
33+
634<dl >
735 <dt ><strong >I'm a beginner...</strong ></dt >
836 <dd >Welcome! PyScript is designed to be friendly for beginner coders. Start
937 with our <a href =" ./beginning-pyscript " >beginning PyScript guide</a >
10- and use
11- <a href =" https://pyscript.com/ " target =" _blank " >pyscript.com</a >
1238 to create your first apps. Graduate to the
1339 <a href =" ./user-guide " >user guide</a > to grow your understanding.</dd >
1440 <dt ><strong >I'm already technical...</strong ></dt >
You can’t perform that action at this time.
0 commit comments