Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #104267
| Path | csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail |
|---|---|
| From | Ian Kelly <ian.g.kelly@gmail.com> |
| Newsgroups | comp.lang.python |
| Subject | Re: Pythonic love |
| Date | Mon, 7 Mar 2016 16:13:28 -0700 |
| Lines | 13 |
| Message-ID | <mailman.0.1457392456.15725.python-list@python.org> (permalink) |
| References | <nbl0lo$5o5$1@gioia.aioe.org> |
| Mime-Version | 1.0 |
| Content-Type | text/plain; charset=UTF-8 |
| X-Trace | news.uni-berlin.de QIqf2ZvhASoRnYuU2i2GSwUeAsED9EujzGNH/IbDHPKg== |
| 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.008 |
| X-Spam-Evidence | '*H*': 0.98; '*S*': 0.00; 'received:209.85.223': 0.03; 'lines.': 0.07; 'none):': 0.07; 'python': 0.10; 'things.': 0.15; '2016': 0.16; '3:51': 0.16; 'itertools': 0.16; 'received:io': 0.16; 'received:psf.io': 0.16; 'wrote:': 0.16; 'skip': 0.18; 'import': 0.24; 'header:In-Reply-To:1': 0.24; 'mon,': 0.24; 'wonder': 0.27; 'message-id:@mail.gmail.com': 0.27; 'perl': 0.29; "i'd": 0.31; 'probably': 0.31; 'received:google.com': 0.35; 'but': 0.36; 'possible.': 0.36; 'received:209.85': 0.36; 'to:addr:python-list': 0.36; 'pm,': 0.36; 'subject:: ': 0.37; 'thanks': 0.37; 'things': 0.38; 'received:209': 0.38; 'to:addr:python.org': 0.40; 'here.': 0.62; 'more': 0.63; 'mar': 0.65; 'to:name:python': 0.84 |
| 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; bh=zv3Yo5zVEq8meydUITMWcmLjtoI1Mmpna53VOBhMQLE=; b=lgTn/L9nn2qHQ045+c0chT3CoC7a+wwCR1gu08kHT+8Y0ctB3N2TXRfnNMkILFj6nI a/ufnHQaIJ5lryq5+UMsexMI2tNq7Y5gzx6Uuqu7afglivZ17xmeiJ8JjjX1yNw66xrZ OzHfWVk5Utjo+cuX/iLnOJ6p2GxknKdJUlVAAPS4axuP/z0Z2tZxtTnh5g5A8LWSKeBL SucmmdHmmCYt+iG2Q6hOMXrUAno9hb3k57QJS7nY+GIHMAblPkiN0NaSAUIe5Tj4q+vV 1JeEIdSNE0MS/zIy1YKvyx9OVmNrcLbL+HhVsS81CVD6t1mkVibSU6rppgCoryOL6VnA 4I3w== |
| X-Google-DKIM-Signature | v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to; bh=zv3Yo5zVEq8meydUITMWcmLjtoI1Mmpna53VOBhMQLE=; b=ImywQrPGAXzjrExjgmD5/7tCDoqSsYKsuqrUIGYlS3MWFymrA85TRNK7fHzVwFsVvY tSnUaa4hgk55tmfiLPsXX30xj3kgbMkco665QUrBNayGd2VxG5EjJGoRPcCmNTSAx5/I rxvyrXcnAk8mfqL7aT2NaErMGst7HUbxOr9Rfwm2rsjtgbWawFdFovovKr5JhQs0kgr8 B5DQCn8BFERZZ8PiViVT9NbYkApQ/Nsu2uF+SiIgfZlvYhcVSJGzn6tc2MeHTlBqYlsZ HlhVBZNLeXR3NPZ45PRIjZN6kpDY7DeUHXzKf7JSsEi04V+HxNl78Y3rXS9pDtxo2Zhq 46EA== |
| X-Gm-Message-State | AD7BkJL2VMA3dq0lafcAFaBlpERwdAouI2eNhw7MFnYa4eiaVEBN5RdmwzXIjGyp8EOUj1BR2YBdfsvWbH6Fsw== |
| X-Received | by 10.107.19.140 with SMTP id 12mr22803754iot.11.1457392447375; Mon, 07 Mar 2016 15:14:07 -0800 (PST) |
| In-Reply-To | <nbl0lo$5o5$1@gioia.aioe.org> |
| X-BeenThere | python-list@python.org |
| X-Mailman-Version | 2.1.21 |
| Precedence | list |
| List-Id | General discussion list for the Python programming language <python-list.python.org> |
| List-Unsubscribe | <https://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 | <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe> |
| Xref | csiph.com comp.lang.python:104267 |
Show key headers only | View raw
On Mon, Mar 7, 2016 at 3:51 PM, Fillmore <fillmore_remove@hotmail.com> wrote:
>
> 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
I'd probably use itertools.islice.
from itertools import islice
for line in isiice(pfile, 5, None):
allVals = line.strip().split("\t")
print(allVals)
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll 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