How can I check if my script is runnig local or at share.streamlit.io ??
You could distinguish it by characteristics e.g. with platform
or the (public) ip address or something else…
For example platform.processor()
returns nothing on streamlit sharing but should return something on a local computer.