Skip to content

Instantly share code, notes, and snippets.

@wdv4758h
Created January 5, 2016 19:10
Show Gist options
  • Select an option

  • Save wdv4758h/17ca729c4faf5eb909d7 to your computer and use it in GitHub Desktop.

Select an option

Save wdv4758h/17ca729c4faf5eb909d7 to your computer and use it in GitHub Desktop.
from zdict import zdict
from PyQt5.QtWidgets import QApplication
import sys
import signal
if __name__ == '__main__':
signal.signal(signal.SIGINT, signal.SIG_DFL)
app = QApplication([])
clipboard = app.clipboard()
def query():
word = clipboard.text(clipboard.Selection)
sys.argv = ['', word]
try:
zdict.main()
except:
pass
clipboard.selectionChanged.connect(query)
app.exec()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment