Right click copy power table cell value to clip board?

I have a power table. I want to make it so that right clicking a cell allows you to copy contents to your clipboard. I tried this -

	def copyCellToClipboard(evt, cellValue=value):
    	import os
	    command = 'echo ' + cellValue + '| clip'
	    os.system(command)
    menu = system.gui.createPopupMenu({'Copy':copyCellToClipboard})
    menu.show(event)

but it does not work. How can I make this work?

See this post for code that works for me.

3 Likes

Worked perfectly thanks!