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


Groups > comp.lang.python > #104262

Pythonic love

Path csiph.com!aioe.org!.POSTED!not-for-mail
From Fillmore <fillmore_remove@hotmail.com>
Newsgroups comp.lang.python
Subject Pythonic love
Date Mon, 7 Mar 2016 17:51:36 -0500
Organization Aioe.org NNTP Server
Lines 16
Message-ID <nbl0lo$5o5$1@gioia.aioe.org> (permalink)
NNTP-Posting-Host SxA1UDOcaYBihz5zYbn9yQ.user.gioia.aioe.org
Mime-Version 1.0
Content-Type text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding 7bit
X-Complaints-To abuse@aioe.org
User-Agent Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0
X-Mozilla-News-Host news://nntp.aioe.org:119
X-Notice Filtered by postfilter v. 0.8.2
Xref csiph.com comp.lang.python:104262

Show key headers only | View raw


learning Python from Perl here. Want to do things as Pythonicly as possible.

I am reading a TSV, but need to skip the first 5 lines. The following 
works, but wonder if there's a more pythonc way to do things. Thanks

ctr = 0
with open(prfile,mode="rt",encoding='utf-8') as pfile:
     for line in pfile:
         ctr += 1

         if ctr < 5:
             continue

         allVals = line.strip().split("\t")
         print(allVals)

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


Thread

Pythonic love Fillmore <fillmore_remove@hotmail.com> - 2016-03-07 17:51 -0500
  Re: Pythonic love Rob Gaddi <rgaddi@highlandtechnology.invalid> - 2016-03-07 22:52 +0000
  Re: Pythonic love sohcahtoa82@gmail.com - 2016-03-07 15:03 -0800
    Re: Pythonic love Fillmore <fillmore_remove@hotmail.com> - 2016-03-07 18:12 -0500
  Re: Pythonic love Ian Kelly <ian.g.kelly@gmail.com> - 2016-03-07 16:13 -0700
  Re: Pythonic love Mark Lawrence <breamoreboy@yahoo.co.uk> - 2016-03-07 23:19 +0000
  Re: Pythonic love jmp <jeanmichel@sequans.com> - 2016-03-08 14:25 +0100
  Re: Pythonic love justin walters <walters.justin01@gmail.com> - 2016-03-08 08:49 -0800
  Re: Pythonic love Mark Lawrence <breamoreboy@yahoo.co.uk> - 2016-03-08 16:55 +0000
  Re: Pythonic love jmp <jeanmichel@sequans.com> - 2016-03-08 18:00 +0100
  Re: Pythonic love justin walters <walters.justin01@gmail.com> - 2016-03-08 09:17 -0800
    Re: Pythonic love jstitch@invernalia.homelinux.net (Javier Novoa C.) - 2016-03-08 11:27 -0600
      Re: Pythonic love Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2016-03-08 21:10 -0500

csiph-web