Copying string value to clipboard
<p>I am trying to copy a string to clipboard in Python, as per the question <a href="https://stackoverflow.com/questions/579687/how-do-i-copy-a-string-to-the-clipboard-on-windows-using-python">How do I copy a string to the clipboard on Windows using Python?</a></p>

<p>My current code is:</p>

<pre><code>  from Tkinter import Tk
  r = Tk()
  r.withdraw()
  r.clipboard_clear()
  variable_desired = "text to copy"
  r.clipboard_append(variable_desired)
</code></pre>

<p>However, when i paste into notepad, i get the name of the variable (e.g. "variable_desired") copied, rather than the value of that variable. Moreover, it doesn't paste into e.g. the chrome browser.</p>