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


Groups > comp.lang.python > #79201

Re: Question About Running Python code

From Andrew Jaffe <a.h.jaffe@gmail.com>
Subject Re: Question About Running Python code
Date 2014-10-16 09:11 +0100
References <f5931a20-dfc0-4ebd-b205-b3e0e966b634@googlegroups.com>
Newsgroups comp.lang.python
Message-ID <mailman.14915.1413447085.18130.python-list@python.org> (permalink)

Show all headers | View raw


On 15/10/2014 23:50, ryguy7272 wrote:
> The error that I get is this.
> 'invalid syntax'
>
> The second single quote in this line is highlighted pink.
> print 'Downloading data from Yahoo for %s sector' % sector

This is a script written for Python 2.*, but you say you are using 
Python 3.4. In Python 3, "print" is a function, not a statement, so you 
need to translate this to

   print('Downloading data from Yahoo for %s sector' % sector)


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


Thread

Question About Running Python code ryguy7272 <ryanshuell@gmail.com> - 2014-10-15 15:50 -0700
  Re: Question About Running Python code Dan Stromberg <drsalists@gmail.com> - 2014-10-15 16:09 -0700
  Re: Question About Running Python code Andrew Jaffe <a.h.jaffe@gmail.com> - 2014-10-16 09:11 +0100

csiph-web