From: Andre W. <wo...@us...> - 2005-10-21 14:03:01
|
Hi, On 21.10.05, Hagai Cohen wrote: > I have tried a lot of combination with your example, > but It always throws the error below: > > Traceback (most recent call last): > File "C:\Programs\Python\Lib\site-packages\pythonwin\pywin\framework\scriptutils.py", > line 310, in RunScript > exec codeObject in __main__.__dict__ > File "D:\tar\Mekorot\mekorot_python\Hebrew2.py", line 4, in ? > text.texmessage.loadfd.pattern = re.compile(r"\((?P[^)]+(\.fd|\.def))\)") > File "C:\Programs\Python\Lib\sre.py", line 179, in compile > return _compile(pattern, flags) > File "C:\Programs\Python\Lib\sre.py", line 230, in _compile > raise error, v # invalid expression > error: unknown specifier: ?P[ > > Sorry about my stupidity, but what is my problem? This is a regular expression problem. The proper regular expression has a lowerthan-character, the string "filename", and a greaterthan-character immedately after the capital P. It might be a problem related to the email-system, which might strip away this string, since it is html-like (just a wild guess). I include the proper regular expression again ... maybe you can properly extract it now: pattern = re.compile(r"\((?P<filename>[^)]+(\.fd|\.def))\)") (You can also take a look in the CVS (using the ViewCVS for example), where the proper regular expression is now inserted in the file pyx/text.py. Note also, that the P<filename>-part is not changed compared to the version you can find in pyx/text.py in the 0.8.1 source distribution of PyX.) Beside that -- this is another but also important issue -- you could try whether your LaTeX system is able to handle utf8 input encoding. You need the ucs-package installed for that and than a file like \documentclass{article} \usepackage{ucs} \usepackage[utf8x]{inputenc} \begin{document} ... some unicode characters in utf-8 encoding ... \end{document} should be smoothly processed by latex. HTH, André -- by _ _ _ Dr. André Wobst / \ \ / ) wo...@us..., http://www.wobsta.de/ / _ \ \/\/ / PyX - High quality PostScript and PDF figures (_/ \_)_/\_/ with Python & TeX: visit http://pyx.sourceforge.net/ |