title: How can I copy a dataframe to my clipboard (or workaround) from Google Colaboratory?
body: <p>I'm building a web scraper for a non-technical user on google colaboratory and want the output of that scraper which is in the form of a <code>pandas</code> dataframe to be <em><code>"copy pastable"</code></em> with a single inline command.</p>
  
  <p>The execution of <code>df.to_clipboard()</code> results in the following error:</p>
  
  <pre><code>/usr/local/lib/python3.6/dist-packages/pandas/core/generic.py in to_clipboard(self, excel, sep, **kwargs)
     2827         from pandas.io import clipboards
     2828 
  -&gt; 2829         clipboards.to_clipboard(self, excel=excel, sep=sep, **kwargs)
     2830 
     2831     def to_xarray(self):
  
  /usr/local/lib/python3.6/dist-packages/pandas/io/clipboards.py in to_clipboard(obj, excel, sep, **kwargs)
      118             text = buf.getvalue()
      119 
  --&gt; 120             clipboard_set(text)
      121             return
      122         except TypeError:
  
  /usr/local/lib/python3.6/dist-packages/pandas/io/clipboard/clipboards.py in __call__(self, *args, **kwargs)
      122     class ClipboardUnavailable:
      123         def __call__(self, *args, **kwargs):
  --&gt; 124             raise PyperclipException(EXCEPT_MSG)
      125 
      126         def __bool__(self):
  
  PyperclipException: 
  PyperclipException: 
      Pyperclip could not find a copy/paste mechanism for your system.
      For more information, please visit https://pyperclip.readthedocs.org 
  </code></pre>
  
  <blockquote>
    <p><em>My Q is similar to this question: <a href="https://stackoverflow.com/questions/53234480/pandas-read-clipboard-from-cloud-hosted-jupyter">pandas.read_clipboard from cloud-hosted jupyter?
    </a> 
     Though my Q applies to Google's Colab – I suspect there's a built in workaround...</em></p>
  </blockquote>