✊🏿 Black Lives Matter. Please consider donating to Black Girls Code today.
🧬 Learn how to build RNA-Seq data apps with Python & Dash. Register for the May 20 Webinar!

Copy to clipboard in client system

Hi friends! I need your help
I made an app for my colleagues, in one part of this app generates python dict with data
what i need is to make “copy to clipboard” mechanism, i’v made it with pyperclip, but it works only lockaly, doesn’t work on server =(

according to this: https://www.odoo.com/forum/help-1/question/using-pyperclip-to-copy-a-field-text-content-to-clipboard-in-client-system-81362 - i have to make some js code inside my script, but i’m not familiar with js

import dash
import dash_html_components as html

my_dict = {'abc': 123}

app = dash.Dash()
app.layout = html.Div([
    html.Button('copy', id='button')
])

if __name__ == '__main__':
    app.run_server()

what should i do next, to copy my_dict to clipboard?

PS: sorry for my poor English

2 Likes

I need the same feature…