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


Groups > comp.lang.python > #48920

Re: Simple I/O problem can't get solved

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!news.albasani.net!rt.uk.eu.org!newsfeed.xs4all.nl!newsfeed2.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <rosuav@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.128
X-Spam-Level *
X-Spam-Evidence '*H*': 0.76; '*S*': 0.02; '21,': 0.07; "wouldn't": 0.14; 'expecting': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'wrote:': 0.18; 'print': 0.22; '(such': 0.24; 'subject:problem': 0.24; 'subject:/': 0.26; 'header :In-Reply-To:1': 0.27; 'message-id:@mail.gmail.com': 0.30; 'lines': 0.31; 'minor': 0.31; 'file': 0.32; 'fri,': 0.33; "i'd": 0.34; 'received:google.com': 0.35; 'consist': 0.36; 'subject:Simple': 0.36; 'to:addr:python-list': 0.38; 'pm,': 0.38; 'subject:can': 0.39; 'to:addr:python.org': 0.39; "you're": 0.61; 'name': 0.63; 'combining': 0.68; 'subject:get': 0.81; 'detecting': 0.84; 'otten': 0.84; '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:date:message-id:subject:from:to :content-type; bh=MoNMCLvY0oLJOwWNGJ/rW8l4Rv7CHQjBimTwLAQCtYA=; b=RmDFGP13mz8/Lij7yBCCmqu8uND0WoTzwS5K+daal83RE8Kd6NCkfidG3Jmsmjgzhf tUkLee98b71nhm6IZSMPSdw3MNByIGdgEpi/sW79IJOrsjCfmUtDrMCYqy/m7DutT01i /TaDvXYRr66Yri2Gq9IpxvvRH9tKM/zT85KO4QdxRGYjuHSqX/IvvkYFhSXzim3U7BI0 63uOkYTNKR94Ho0DxSGoQr/ilfFD34qCdLt/ejQL/jDqBFr/yFe4CXLPscjaPWw1xKHj O8fvoghrqjMQSkDXGtlDPEk6alwVbvEoiZ+nYrPsMkvhiPps45U5ZvsQwpeZqjK9bZbV q77Q==
MIME-Version 1.0
X-Received by 10.220.182.193 with SMTP id cd1mr7292745vcb.32.1371892079290; Sat, 22 Jun 2013 02:07:59 -0700 (PDT)
In-Reply-To <kq15i6$80e$1@ger.gmane.org>
References <4785de5f-a84d-4417-9709-68bf2f4076e8@googlegroups.com> <kq15i6$80e$1@ger.gmane.org>
Date Sat, 22 Jun 2013 19:07:59 +1000
Subject Re: Simple I/O problem can't get solved
From Chris Angelico <rosuav@gmail.com>
To python-list@python.org
Content-Type text/plain; charset=ISO-8859-1
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.3690.1371892081.3114.python-list@python.org> (permalink)
Lines 14
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1371892081 news.xs4all.nl 15897 [2001:888:2000:d::a6]:44598
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:48920

Show key headers only | View raw


On Fri, Jun 21, 2013 at 7:15 PM, Peter Otten <__peter__@web.de> wrote:
> Combining these modifications:
>
> for line in f:
>     word = line.strip()
>     if is_palindrome.is_palindrome(word):
>         print word

Minor quibble: I wouldn't use the name 'word' here, unless you're
expecting the file to consist of one-word lines (such as DICTOT.DIC
from old PMMail). For detecting phrase/sentence palindromes, I'd keep
the name 'line'.

ChrisA

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


Thread

Simple I/O problem can't get solved nickgan.sps@windowslive.com - 2013-06-21 01:57 -0700
  Re: Simple I/O problem can't get solved Jussi Piitulainen <jpiitula@ling.helsinki.fi> - 2013-06-21 12:11 +0300
  Re: Simple I/O problem can't get solved Peter Otten <__peter__@web.de> - 2013-06-21 11:15 +0200
    Re: Simple I/O problem can't get solved nickgan.sps@windowslive.com - 2013-06-21 02:20 -0700
  Re: Simple I/O problem can't get solved Chris Angelico <rosuav@gmail.com> - 2013-06-22 19:07 +1000
  Re: Simple I/O problem can't get solved Peter Otten <__peter__@web.de> - 2013-06-22 12:11 +0200
  Re: Simple I/O problem can't get solved Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2013-06-22 12:58 -0400

csiph-web