Python i18n using pygettext.py
Question: I am starting on localisation, but I get stuck.

  1. The program 
    
        #example.py
    import gettext
    t = gettext.translation('cn', 'C:\locale', fallback=True)
    _ = t.ugettext 
    print _('Hello!') 
    

does work.

  2. But when try to use pygettext
    
        python pygettext.py -d cn -o cn.pot example.py 
    

I get the message `"invalid syntax:<string>, line 1, pos 18`

I tried even the most simple pygettest command :

    
    
    python pygettext.py example.py  
    

which returns the same error. I have tried with different other settings and
changes in the program, but this error keeps returning.

The complete example I used the code from is <http://achilles-keep-
moving.blogspot.nl/2011/07/minimal-tutorial-for-python.html>

What I am doing wrong?


Answer: You should escape the `\` character in the string like `'C:\\foo.bar'` or
`r'C:\foo.bar'`.

