xref: /netbsd-src/external/gpl2/gettext/dist/gettext-tools/examples/hello-python/hello.py.in (revision 181254a7b1bdde6873432bffef2d2decc4b5c22f)
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