How to skip the "Welcome to Streamlit" message?

Summary

I writing a python application and part of it is a streamlit dashboard which is launched with the command below:

import subprocess
subprocess.Popen(["streamlit", "run", filename])

That however produces the welcome message

👋 Welcome to Streamlit!
      If you’d like to receive helpful onboarding emails, news, offers, promotions,
      and the occasional swag, please enter your email address below. Otherwise,
      leave this field blank.
      Email:

and the dashboard doesnt open because it waits for a keystroke. How can I skip the welcome message please?

I have seen this similar post from Jun 22, however I dont quite get why this is good practice.

I am deploying my app as a python package to the users. Why should we somehow create an empty credentials.toml file and risk overwriting an existing toml with some useful details

Greetings @gmiliotis !

Simple and Standard fix for this is to use a redirection.

For Linux/ MacOSX

streamlit run app.py > dev/null

For Windows

streamlit run app.py > NUL

So you use it like this:

subprocess.Popen(["streamlit", "run", filename, '> /dev/null'])

Thanks! Thats a nice idea indeed! For future reference, if anyone else is looking into this, a cross-platfom command would be

import os
subprocess.Popen(["streamlit", "run", filename, os.devnull])

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.