@@ -28,7 +28,9 @@ $ pip install pyscript
28
28
29
29
## Usage
30
30
31
- ### Embed a Python script into a PyScript HTML file
31
+ ### wrap
32
+
33
+ #### Embed a Python script into a PyScript HTML file
32
34
33
35
``` shell
34
36
$ pyscript wrap < filename.py>
@@ -41,25 +43,49 @@ This can be overwritten with the `-o` or `--output` option:
41
43
$ pyscript wrap < filename.py> -o < another_filename.html>
42
44
```
43
45
44
- ### Open the script inside the browser using the ` --show ` option
46
+ #### Open the script inside the browser using the ` --show ` option
45
47
46
48
``` shell
47
49
$ pyscript wrap < filename.py> --show
48
50
```
49
51
50
- ### Set a title for the browser tab
52
+ #### Set a title for the browser tab
51
53
52
54
You can set the title of the browser tab with the ` --title ` option:
53
55
54
56
``` shell
55
57
$ pyscript wrap < filename.py> --title " My cool app!"
56
58
```
57
59
58
- ### Very simple command examples with ` --command ` option
60
+ #### Very simple command examples with ` --command ` option
59
61
60
62
The ` -c ` or ` --command ` option can be used to demo very simple cases.
61
63
In this case, if the ` --show ` option is used and no ` --output ` file is used, a temporary file will be generated.
62
64
63
65
``` shell
64
66
$ pyscript wrap -c ' print("Hello World!")' --show
65
67
```
68
+
69
+ ### run
70
+
71
+ #### Spin up a local server to run on the path and specified port
72
+
73
+ ``` shell
74
+ $ pyscript run < path_of_folder>
75
+ ```
76
+
77
+ This will serve the folder ` path_of_folder ` at ` localhost:8000 ` by default
78
+ and will open the URL in a browser window. Default is current directory if
79
+ ` path_of_folder ` is not supplied.
80
+
81
+ To use a different port, use ` --port ` option.
82
+
83
+ ``` shell
84
+ $ pyscript run < path_of_folder> --port 9000
85
+ ```
86
+
87
+ To avoid opening a browser window, use ` --silent ` option.
88
+
89
+ ``` shell
90
+ $ pyscript run < path_of_folder> --silent
91
+ ```
0 commit comments