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


Groups > comp.lang.python > #69755 > unrolled thread

Re: How can I parse this correctly?

Started byChris Angelico <rosuav@gmail.com>
First post2014-04-06 18:17 +1000
Last post2014-04-06 18:17 +1000
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: How can I parse this correctly? Chris Angelico <rosuav@gmail.com> - 2014-04-06 18:17 +1000

#69755 — Re: How can I parse this correctly?

FromChris Angelico <rosuav@gmail.com>
Date2014-04-06 18:17 +1000
SubjectRe: How can I parse this correctly?
Message-ID<mailman.8942.1396772230.18130.python-list@python.org>
On Sun, Apr 6, 2014 at 4:29 PM, Anthony Papillion <papillion@gmail.com> wrote:
> No particular reason at all. I've Bern dabbling in Python for the last bit
> and am just writing code based on the samples or examples I'm finding.  What
> was the tipoff that this was not Python 3? Would there be a large difference
> in this code if it was Python 3?

The tip-off was that you have no parentheses around print's arguments.
Behold the vast difference that told me which it was:

# Python 2: print is a statement
print int(row['YEAR'])

# Python 3: print is a function
print(int(row['YEAR']))

So incredibly different :) But it's enough to show that you're on Python 2.

ChrisA

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web