Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #49179

Re: newbie question

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.freenet.ag!news2.euro.net!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <ian.g.kelly@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.029
X-Spam-Evidence '*H*': 0.94; '*S*': 0.00; 'charset:iso-8859-7': 0.04; '22,': 0.09; 'subject:question': 0.10; 'buffer.': 0.16; 'uppercase': 0.16; 'sat,': 0.16; 'wrote:': 0.18; '>>>': 0.22; 'keyboard': 0.24; 'question': 0.24; 'compare': 0.26; 'asking': 0.27; 'header:In-Reply-To:1': 0.27; 'correct': 0.29; 'character': 0.29; 'message-id:@mail.gmail.com': 0.30; "skip:' 10": 0.31; 'comparison': 0.31; 'yes.': 0.31; 'received:google.com': 0.35; 'false': 0.36; 'thanks': 0.36; 'being': 0.38; 'to:addr:python- list': 0.38; 'pm,': 0.38; 'to:addr:python.org': 0.39; 'simple': 0.61; 'email addr:gmail.com': 0.63; 'saturday': 0.68; '2013': 0.98
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type:content-transfer-encoding; bh=yDphsHcqLJ9Ajge8Ppci8OUiav5AvKWZ7OgRMFQWF6A=; b=bgpTv80D0hvWLHVrPM908bBMe9S7UQ4VQ5eo3800g/lXZn7o0msNR2VdAyoMT796lc ilpRIMU0ezQFHNVZ+m+tmQEro2UZ+pHCvd67msv+gowhz7OnfM3+XLoYmqG9Fhcrj1dJ q2RE9rNgyDC0Wf5QoifVOTeqe3GzQ6VooxYIJ1Wsx/7Rdrnod7Tw1aUEAiMeElzHrxYK OTKuiql3dGxYNu/5OsFQEtu982DdtwUSfcTVsju7zLh5mLew8R9MGi9NurYaxTmiMbam KHG85yyPZ935HN45gYx9kvb5RaXQdteC089rhHMCGFpm2QDXvSk+0eemReg2h1bST4GD al1w==
X-Received by 10.66.27.172 with SMTP id u12mr1062023pag.209.1372187157689; Tue, 25 Jun 2013 12:05:57 -0700 (PDT)
MIME-Version 1.0
In-Reply-To <201306222249.33354.gheskett@wdtv.com>
References <195f7100-c4bf-414d-a92f-5b8a70d896f7@googlegroups.com> <201306222249.33354.gheskett@wdtv.com>
From Ian Kelly <ian.g.kelly@gmail.com>
Date Tue, 25 Jun 2013 13:05:17 -0600
Subject Re: newbie question
To Python <python-list@python.org>
Content-Type text/plain; charset=ISO-8859-7
Content-Transfer-Encoding quoted-printable
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.3842.1372187160.3114.python-list@python.org> (permalink)
Lines 20
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1372187160 news.xs4all.nl 15889 [2001:888:2000:d::a6]:59370
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:49179

Show key headers only | View raw


On Sat, Jun 22, 2013 at 8:49 PM, Gene Heskett <gheskett@wdtv.com> wrote:
> On Saturday 22 June 2013 22:46:51 christhecomic@gmail.com did opine:
>
>> Writing simple program asking a question with the answer being
>> "yes"...how do I allow the correct answer if user types Yes, yes, or
>> YES?
>>
>> Thanks
>
> AND each character coming in from the keyboard with $DF before adding it to
> the comparison buffer.  Makes it all uppercase.  Then compare it to the
> uppercase YES.

It's not working for me.

>>> ''.join(chr(ord(c) & 0xdf) for c in 'ναί') == 'ΝΑΊ'
False
>>> ''.join(chr(ord(c) & 0xdf) for c in 'ναί')
'\x9d\x91\x8f'

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

newbie question christhecomic@gmail.com - 2013-06-22 19:39 -0700
  Re: newbie question Rick Johnson <rantingrickjohnson@gmail.com> - 2013-06-22 19:50 -0700
  Re: newbie question Chris Angelico <rosuav@gmail.com> - 2013-06-23 12:48 +1000
  Re: newbie question Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-06-23 03:08 +0000
  Re: newbie question Gene Heskett <gheskett@wdtv.com> - 2013-06-22 22:49 -0400
  Re: newbie question Ian Kelly <ian.g.kelly@gmail.com> - 2013-06-25 13:05 -0600
  Re: newbie question Tim Rowe <digitig@gmail.com> - 2013-06-25 20:26 +0100

csiph-web