API reference¶
- streamlitrunner.run(
- func: Callable[[...], Any] | None = None,
- funcargs: Sequence[Any] | None = None,
- funckwargs: dict[str, Any] | None = None,
- *,
- title: str = 'Streamlit runner app',
- maximized: bool = True,
- open_as_app: bool = True,
- print_msgs: bool = True,
- fill_page_content: bool = False,
- screen: int | None = None,
- **kwargs,
- streamlitrunner.run(**kwargs) Any | None
Run the script file as a streamlit app and exits.
Executes the command
streamlit run <script.py>before exit the program.The parameters of this function have preference over the runtime config variable
streamlitrunner.rcParameters¶
func(Callable[..., Any] | None, optional): Defaults toNone.A function to run.
funcargs(Sequence[Any] | None, optional): Defaults toNone.Positional arguments passed to function
func.
funckwargs(dict[str, Any] | None, optional): Defaults toNone.Keyword arguments passed to function
func.
title(str, optional): Defaults to"Streamlit runner app".The title of the new window.
maximized(bool, optional): Defaults toTrue.Whether or not to start the window maximized.
open_as_app(bool, optional): Defaults toTrue.Whether to open the browser with webview launching the url in “application mode” in its own native window (separate window). If
True, the optionSTREAMLIT_SERVER_HEADLESSis set toTrue.
print_msgs(bool, optional): Defaults toTrue.Whether to print the command executed by this function and other messages.
fill_page_content(bool, optional): Defaults toFalse.Whether to fill the web page removing empty spaces.
screen(int | None, optional): Defaults toNone.The screen number to display the window on, if
open_as_app=True.
**kwargs: Additional keyword arguments passed as options to thestreamlit runcommand. These keyword arguments have the same names as the environment variables, but passed with lower case and without the prefix
streamlit_. Usestreamlit run --helpto get a list.Some values are predefined, if not given. Namely:
client_toolbar_mode(STREAMLIT_CLIENT_TOOLBAR_MODE) ="minimal"server_headless(STREAMLIT_SERVER_HEADLESS):Trueifopen_as_app=Trueserver_run_on_save(STREAMLIT_SERVER_RUN_ON_SAVE) =Trueserver_port(STREAMLIT_SERVER_PORT) =8501theme_base(STREAMLIT_THEME_BASE) ="light"
Returns¶
Any | None:If
funcis notNone, return its result. Otherwise, returnsNone.