File tree 1 file changed +49
-0
lines changed 1 file changed +49
-0
lines changed Original file line number Diff line number Diff line change
1
+ # Getting started with PyScript
2
+
3
+ This page will guide you through getting started with PyScript.
4
+
5
+ ## Development setup
6
+
7
+ PyScript does not require any development environment other
8
+ than a web browser. We recommend using Chrome.
9
+
10
+ ## Installation
11
+
12
+ First, go to https://pyscript.net and download the PyScript assets.
13
+ Unzip the archive to a directory where you wish to write PyScript-enabled
14
+ HTML files. You should then have three files in your directory.
15
+
16
+ ```
17
+ ├── ./
18
+ │ ├── pyscript.css
19
+ │ ├── pyscript.js
20
+ │ └── pyscript.js.map
21
+ ```
22
+
23
+ ## Your first PyScript HTML file
24
+
25
+ Here's a "Hello, world!" example using PyScript using the assets you
26
+ downloaded from https://pyscript.net .
27
+
28
+ Using your favorite editor create a new file called ` hello.html ` in
29
+ the same directory as your PyScript JavaScript and CSS files with the
30
+ following content and open the file in your web browser. You can typically
31
+ open an HTML by double clicking it in your file explorer.
32
+
33
+ ``` html
34
+ <html >
35
+ <head >
36
+ <link rel =" stylesheet" href =" pyscript.css" />
37
+ <script defer src =" pyscript.js" ></script >
38
+ </head >
39
+ <body > <py-script > print('Hello, World!') </py-script > </body >
40
+ </html >
41
+ ```
42
+
43
+ Notice the use of the ` <py-script> ` tag in the HTML body. This
44
+ is where you'll write your Python code. In the following sections we'll
45
+ introduce the 8 tags provided by PyScript.
46
+
47
+ ## The py-script tag
48
+
49
+ ...
You can’t perform that action at this time.
0 commit comments