Created
January 5, 2016 19:10
-
-
Save wdv4758h/17ca729c4faf5eb909d7 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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