@@ -28,7 +28,9 @@ $ pip install pyscript
2828
2929## Usage
3030
31- ### Embed a Python script into a PyScript HTML file
31+ ### wrap
32+
33+ #### Embed a Python script into a PyScript HTML file
3234
3335``` shell
3436$ pyscript wrap < filename.py>
@@ -41,25 +43,49 @@ This can be overwritten with the `-o` or `--output` option:
4143$ pyscript wrap < filename.py> -o < another_filename.html>
4244```
4345
44- ### Open the script inside the browser using the ` --show ` option
46+ #### Open the script inside the browser using the ` --show ` option
4547
4648``` shell
4749$ pyscript wrap < filename.py> --show
4850```
4951
50- ### Set a title for the browser tab
52+ #### Set a title for the browser tab
5153
5254You can set the title of the browser tab with the ` --title ` option:
5355
5456``` shell
5557$ pyscript wrap < filename.py> --title " My cool app!"
5658```
5759
58- ### Very simple command examples with ` --command ` option
60+ #### Very simple command examples with ` --command ` option
5961
6062The ` -c ` or ` --command ` option can be used to demo very simple cases.
6163In this case, if the ` --show ` option is used and no ` --output ` file is used, a temporary file will be generated.
6264
6365``` shell
6466$ pyscript wrap -c ' print("Hello World!")' --show
6567```
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