I want to translate strings in my Python app on my Mac OS X 10.7.
I can import the gettext module but i can’t find the tools pygettext.py and msgfmt.py, which according to the Python docs should be somewhere in my Python installation.
Is the pre-installed Python version on Mac OS X 10.7 missing these tools and if yes, how can I get them?
Thanks.
Both of those scripts reside in the miscellaneous Tools directory of the Python source. This directory is often not included in a binary installation of Python such as the ones supplied by Apple in OS X. However, it is easy to download them separately from a Python source release; see the most recent releases here. For the current Python 2.7.3 release, you could do the following:
Beginning with Python 3.2, the
Toolsdirectory is installed by python.org OS X binary installers. You’ll find it inside the Python framework at: