xref: /netbsd-src/external/gpl2/gettext/dist/gettext-tools/examples/hello-python/hello.py.in (revision 946379e7b37692fc43f68eb0d1c10daa0a7f3b6c)
1# Example for use of GNU gettext.
2# Copyright (C) 2003 Free Software Foundation, Inc.
3# This file is in the public domain.
4#
5# Source code of the Python program.
6
7import gettext
8import os
9
10gettext.textdomain('hello-python')
11gettext.bindtextdomain('hello-python', '@localedir@')
12
13print gettext.gettext("Hello, world!")
14print gettext.gettext("This program is running as process number %(pid)d.") \
15      % { 'pid': os.getpid() }
16