How to obtain user’s Windows username?
you can use the getpass module:
import streamlit as st import getpass st.write(getpass.getuser())
However this gives you the user-name for th3e user who started the app. If you run your apps locally, this is fine, however if the app runs on a server, I dont think there is an easy solution to do this.