Why don't work this code on Python 2.6? Or how can I do this job?
_MAP = {
# LATIN
u'À': 'A', u'Á': 'A', u'Â': 'A', u'Ã': 'A', u'Ä': 'A', u'Å': 'A',
u'Æ': 'AE', u'Ç':'C',
u'È': 'E', u'É': 'E', u'Ê': 'E', u'Ë': 'E', u'Ì': 'I', u'Í': 'I',
u'Î': 'I',
u'Ï': 'I', u'Ð': 'D', u'Ñ': 'N', u
On 30. Sep., 09:41 h., Andre Engels wrote:
> On Wed, Sep 30, 2009 at 9:34 AM, gentlestone wrote:
> > Why don't work this code on Python 2.6? Or how can I do this job?
>
> Please be more specific than "it doesn't work":
> * What exactly are you doing
> * W
On 30. Sep., 10:35 h., Andre Engels wrote:
> I get the feeling that the problem is with the Python interactive
> mode. It does not have full unicode support, so u"Žabovitá zmiešaná
> kaša" is changed to u'\x8eabovit\xe1 zmie\x9aan\xe1 ka\x9aa'. If you
> call your code from another program, it migh
On 30. Sep., 10:43 h., gentlestone wrote:
> On 30. Sep., 10:35 h., Andre Engels wrote:
>
> > I get the feeling that the problem is with the Python interactive
> > mode. It does not have full unicode support, so u"Žabovitá zmiešaná
> > kaša" is changed to u
On 30. Sep., 11:45 h., Dave Angel wrote:
> gentlestone wrote:
> > Why don't work this code on Python 2.6? Or how can I do this job?
>
> > _MAP =
> > # LATIN
> > u'À': 'A', u'Á': 'A', u'Â': 'A'
>save in utf-8 the coding declaration also has to be utf-8
ok, I understand, but what's the problem? Unfortunately seems to be
the Python interactive
mode doesn't have unicode support. It recognize the latin-1 encoding
only.
So I have 2 options, how to write doctest:
1. Replace native charaters w
Thx for useful advices. They seems to be very clever.
Thx to dajngo users comunity, I've got a nice solution, how to avoid
unicode problems in doctests:
"""
>>> Osoba(meno = "Ľudmila".decode('utf-8'), priezvisko =
"Šafářová".decode('utf-8'))
"""
It is - do not use unicode string
Suppose I've saved the class name and (don't know how) I've also saved
the Class's module (package path or I don't know what's the name for
XYZ "from X.Y.Z import ...). How can I construct a new class according
to saved informations? If I don't know what Class it could be, only I
have the saved Cla
On 6. Okt, 08:55 h., Steven D'Aprano
wrote:
> On Mon, 05 Oct 2009 23:32:27 -0700, gentlestone wrote:
> > Suppose I've saved the class name and (don't know how) I've also saved
> > the Class's module (package path or I don't know what's the n
Hi,
suppose my source code looks like:
import aspect_xy
class Basic(object, aspect_xy.Basic):
pass # basic attributes and methods ...
and the source code of aspect_xy.py is:
class Basic(obj
Hi, is there some well-known problems with class method monkey
patching?
I've got this error message:
unbound method get_pocet_neocislovanych() must be called with Pozemok
instance as first argument (got Subjekt instance instead)
The method is declared as:
@classmethod
@monkeypatch(Dokument)
def
On 3. Mar., 12:57 h., gentlestone wrote:
> Hi, is there some well-known problems with class method monkey
> patching?
>
> I've got this error message:
>
> unbound method get_pocet_neocislovanych() must be called with Pozemok
> instance as first argument (got Subjekt
On 3. Mar., 13:09 h., Bruno Desthuilliers wrote:
> gentlestone a écrit :
>
>
>
> > Hi, is there some well-known problems with class method monkey
> > patching?
>
> > I've got this error message:
>
> > unbound method get_pocet_neocislovanych() mu
Hi, how can I write the popular C/JAVA syntax in Python?
Java example:
return (a==b) ? 'Yes' : 'No'
My first idea is:
return ('No','Yes')[bool(a==b)]
Is there a more elegant/common python expression for this?
--
http://mail.python.org/mailman/listinfo/python-list
Can somebody give me an advise where I can found a really good online
tutorial? All I found are useless. For example no tutorial I found
explains this piece of code:
someList = [element for element in otherList if element is not
None]
or this example:
a = a or []
There are only stupid e
return u"{}".format(self.name)
this one doesn't work on unicode strings. I there a not old formatting
style possibilty for unicode strings?
Note: self.name can be unicode string!
--
http://mail.python.org/mailman/listinfo/python-list
On 9. Sep., 12:31 h., Tim Northover
wrote:
> gentlestone writes:
> > return u"{}".format(self.name)
>
> > this one doesn't work on unicode strings. I there a not old formatting
> > style possibilty for unicode strings?
>
> It looks like you're
17 matches
Mail list logo