On Streamlit Cloud, your Python app runs in the Cloud and you visualize your Streamlit app on your browser. Those are two separate machines. Calling any copy/paste will run in the Cloud and not have access to the browser’s clipboard.
You’ll probably need a mix of:
- Code snippet: create Components without any frontend tooling (no React, Babel, Webpack, etc) - Show the Community! - Streamlit
- Clipboard API - Web APIs | MDN (mozilla.org)
to send data from your browser using the Clipboard API, back to the Python app in the Cloud using the Components API.
Hope this helps kickstart a solution,
Fanilo