Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Top Posters

Who's Online (1)

Powered by Vanilla. Made with Bootstrap.
How to copy string to clipboard
  • s1n4
    Posts: 88
    You can copy string to clipboard with GUI toolkit but how, for example you can use Tkinter. (ah, I should say in python)

    you can copy string to clipboard with the following code.
    (It's just a sample)


    #!/usr/bin/python

    from Tkinter import Tk
    x = Tk()
    x.withdraw()
    x.clipboard_clear()
    i = raw_input(\">> \")
    x.clipboard_append(i)
    x.destroy()

    print repr(i), \"Copied to clipboard\"
    raw_input(\"Press enter to exit\")