Here's a little script that allows you to access the OS X Dictionary app using Python.
The OS X Dictionary app is a powerful built-in tool that provides access to multiple dictionaries, thesauruses, and reference materials. However, accessing it programmatically from the command line can be challenging. This Python script bridges that gap by providing a simple interface to query the Dictionary app directly from your terminal.
The script uses Python's subprocess module to call the built-in open dict:// URL scheme, which triggers the Dictionary app to look up a specific word. This is particularly useful for developers and writers who prefer to stay in the terminal while working and need quick access to word definitions, synonyms, and other reference information.
Practical tip: Make the script executable (chmod +x script_name.py) and add an alias for it in your .bashrc or .zshrc file (e.g., alias dict='python /path/to/script.py') to be able to call it from the command line easily. This way, you can simply type dict word to instantly look up any term.
Cite this blog post:
Comments via Github:
2021
2019
2017
paper Data integration and disintegration: Managing Springer Nature SciGraph with SHACL and OWL
Industry Track, International Semantic Web Conference (ISWC-17), Vienna, Austria, Oct 2017.
paper Fitting Personal Interpretation with the Semantic Web: lessons learned from Pliny
Digital Humanities Quarterly, Jan 2017. Volume 11 Number 1
2015
2014
2013
paper Fitting Personal Interpretations with the Semantic Web
Digital Humanities 2013, University of Nebraska–Lincoln, Jul 2013.
2012
2011
2010
2007
paper PhiloSURFical: browse Wittgensteinʼs Tractatus with the Semantic Web
Wittgenstein and the Philosophy of Information - Proceedings of the 30th International Ludwig Wittgenstein Symposium, Kirchberg, Austria, Aug 2007. pp. 319-335