Re: re.finditer() skips unicode into selection
Thanks MRAB, your suggestion worked. But then it brought an error 'ascii' codec can't encode characters in position 0-1: ordinal not in range(128) I corrected this by encoding it to 'utf-8'. The code looks like this now. pattern = ur'(?u)\w+' def __init__(self, *args): QSyntaxHighlighter.__init__(self, *args) self.dict = None def setDict(self, dict): self.dict = dict def highlightBlock(self, text): if not self.dict: return text = unicode(text) format = QTextCharFormat() format.setUnderlineColor(Qt.red) format.setUnderlineStyle(QTextCharFormat.SpellCheckUnderline) unicode_pattern=re.compile(self.pattern,re.UNICODE) for word_object in unicode_pattern.finditer(text): if not self.dict.spell(word_object.group().encode('utf-8')): print word_object.group().encode('utf-8') self.setFormat(word_object.start(), word_object.end() - word_object.start(), format) The problem now is that all the vowels are separated from the root word, such that if you type मेरो, the म and े are printed separately. (the े appears as a box instead). What am I doing wrong? Like this. मेरो नाम रुपा हो। -- http://mail.python.org/mailman/listinfo/python-list
Re: re.finditer() skips unicode into selection
[IMG]http://i41.tinypic.com/35002rr.png[/IMG] Heres a screenshot http://i41.tinypic.com/35002rr.png -- http://mail.python.org/mailman/listinfo/python-list
Re: re.finditer() skips unicode into selection
Thanks MRAB your alternative regex implementation worked flawlessly. It works now. -- http://mail.python.org/mailman/listinfo/python-list
Devnagari Unicode Conversion Issues
How can i convert text of the following type नà¥à¤ªà¤¾à¤²à¥ into devnagari unicode in Python 2.7? -- http://mail.python.org/mailman/listinfo/python-list
Re: Devnagari Unicode Conversion Issues
That worked out. I was trying to encode it the entire time. Now I realise how silly I am. Thanks MRAB. Once Again. :D -- http://mail.python.org/mailman/listinfo/python-list
Confused approach to Pyinstaller
I have a certain GUI program that I built using Python 2.7 and PyQt4. I want to convert it into a standalone windows executable. I went through the docs for Pyinstaller-2.0 and tried several times but I think that I might be on the wrong approach. Here is the structure of my Program. [Resources] [Hunspell] [stylesheets] resources.py design.py main.py The first three are folders containing necessary files for the program to run. The file main.py imports the other two to run properly. What do I do to go towards making the perfect executable? P.S. I have also imported PyPi modules. Will they make a difference? -- http://mail.python.org/mailman/listinfo/python-list