@@ -103,13 +103,15 @@ as you make changes to the `app.py` file.
103
103
! [](img/010-run_app.png)
104
104
:::
105
105
106
+ :::
107
+
106
108
::: {.callout-tip}
107
109
# # Naming your files
108
110
109
111
If you start your file with the word ` app` ,
110
112
the shiny for python extension will recognize
111
113
it as an application and you will be able to see the " play" button to run your application.
112
- You can also name your file ` app-getting_started .py`
114
+ You can also name your file ` app-get_started .py`
113
115
and you will still get the shiny extension play button.
114
116
115
117
To have Shiny for Python work well with the VS Code extensions and for you to go through
@@ -118,8 +120,12 @@ We recommend either one of the following file naming conventions:
118
120
119
121
1. Create separate folders for each app example you will create and save separate `app.py` files in each folder
120
122
2. Create separate ` app* .py` files in the same directory (e.g., ` app-01.py` , ` app-02.py` )
121
- :::
122
123
124
+ If you named your application ` app.py` you can omit it form the command and only use ` shiny run --reload` .
125
+ The ` app.py` is the default file Shiny looks for to run in the current directory.
126
+ Otherwise, you can pass in the name of the file that you wish to run.
127
+ The ` app` prefix used in the example above is used to signal to the Shiny VS Code extension
128
+ to display the run app button.
123
129
:::
124
130
125
131
# # Run your shiny application
@@ -130,27 +136,19 @@ This is useful if you wish to specify your own port or want to rename your appli
130
136
without the ` app` prefix.
131
137
132
138
` ` ` bash
133
- shiny run my_app.py
139
+ shiny run my_app.py --reload --port 8000
134
140
` ` `
135
141
136
- ::: {.callout-note}
137
- If you named your application ` app.py` you can omit it form the command and only use ` shiny run` .
138
- The ` app.py` is the default file Shiny looks for to run in the current directory.
139
- Otherwise, you can pass in the name of the file that you wish to run.
140
- The ` app` prefix used in the example above is used to signal to the Shiny VS Code extension
141
- to display the run app button.
142
- :::
143
-
144
142
:::{.callout-tip}
145
143
# # Helpful run options
146
144
147
145
Some useful options you can pass the ` shiny run` command are:
148
146
147
+ - ` --reload` : Enables auto-reload, the application will reload to reflect your changes as you save your work.
149
148
- ` --port` : pass in a custom port, e.g., ` --port 8000` .
150
149
This will run the app on the specified port,
151
150
instead of a random port.
152
151
This makes it easier to have the same browser window open as you stop and start your application.
153
- - ` --reload` : Enables auto-reload
154
152
155
153
You can learn more about these run options on the
156
154
[` run_app` documentation page](https://shiny.posit.co/py/api/core/run_app.html).
0 commit comments