Re: Python and Cyrillic characters in regular expression

2008-09-05 Thread phasma
string = u"Привет" (u'\u041f\u0440\u0438\u0432\u0435\u0442',) string = u"Hi.Привет" (u'Hi',) On Sep 4, 9:53 pm, Fredrik Lundh <[EMAIL PROTECTED]> wrote: > phasma wrote: > > Hi, I'm trying extract all alphabetic characters from string.

Python and Cyrillic characters in regular expression

2008-09-04 Thread phasma
Hi, I'm trying extract all alphabetic characters from string. reg = re.compile('(?u)([\w\s]+)', re.UNICODE) buf = re.match(string) But it's doesn't work. If string starts from Cyrillic character, all works fine. But if string starts from Latin character, match returns only Latin characters. Plea

BZip2 decompression and parsing XML

2008-06-06 Thread phasma
Hi. I'm trying to disassemble bzipped file. If I use minidom.parseString, I'm getting this error: Traceback (most recent call last): File "./replications.py", line 342, in ? File "/usr/lib64/python2.4/xml/dom/minidom.py", line 1925, in parseString return expatbuilder.parseString(string)

Export data to OpenDocument Text

2008-03-30 Thread phasma
Hi! I'm trying to save data from sqlite to OpenDocument Text. Code: localtime = time.localtime(time.time()) try: odt_file = zipfile.ZipFile(file_name, "w") except: print("Невозможно открыть файл для