Re: Invalid Syntax

2016-08-09 Thread Steven D'Aprano
On Wed, 10 Aug 2016 06:20 am, Ltc Hotspot wrote: > Hi, Everyone: > > What is the source of the following, > 'error message: SyntaxError: invalid syntax (, line 2)' > > v. Python 3.3 > > Code reads: > > x=1 > if x==1 > # indent 4 spaces > print "x = 1" > > Hal The error message tells

Re: Invalid Syntax

2016-08-09 Thread cs
On 09Aug2016 20:22, Rob Gaddi wrote: Ltc Hotspot wrote: What is the source of the following, 'error message: SyntaxError: invalid syntax (, line 2)' v. Python 3.3 Code reads: x=1 if x==1 # indent 4 spaces print "x = 1" A missing colon, the appropriate location of which is left as an

Re: Invalid Syntax

2016-08-09 Thread Rob Gaddi
Ltc Hotspot wrote: > Hi, Everyone: > > What is the source of the following, > 'error message: SyntaxError: invalid syntax (, line 2)' > > v. Python 3.3 > > Code reads: > > x=1 > if x==1 > # indent 4 spaces > print "x = 1" > > Hal A missing colon, the appropriate location of which is left

Re: Invalid Syntax Installing pip - ez_setup.py

2014-12-01 Thread Billy Furlong
Success. Whats happening is that the second wget command is not recognizing the --no-check-certificate. So I went around the problem and installed it manually. wget https://pypi.python.org/packages/source/s/setuptools/setuptools-7.0.zip --no-check-certificate unzip setuptools-7.0.zip python2.7

Re: Invalid Syntax Installing pip - ez_setup.py

2014-12-01 Thread Billy Furlong
Hi Chris, Yep that got me closer. I found that using | sudo python2.7 was a bad command. So I changed over to | python2.7. [root@myserver tmp]# wget https://bootstrap.pypa.io/ez_setup.py --no-check-certificate -O - | python2.7 --2014-12-01 12:57:07-- https://bootstrap.pypa.io/ez_setup.py Re

Re: Invalid Syntax Installing pip - ez_setup.py

2014-12-01 Thread Chris Angelico
On Tue, Dec 2, 2014 at 3:58 AM, wrote: > Getting an error when I try to install ez_setup.py. I thought that this was > an issues with an incorrect version of python, so I upgraded to 2.7.5 > successfully. But unfortunately I get the same error. > > > File "", line 51 > with archive_cont

Re: Invalid syntax with print "Hello World"

2013-11-14 Thread unknown
On Thu, 14 Nov 2013 07:05:08 -0800, johannes.gunz97 wrote: > Am Donnerstag, 12. März 2009 07:57:11 UTC+1 schrieb Henrik Bechmann: >> obviously total mewbiew: >> >> My first program in Python Windows >> >> print "Hello World" >> >> I select Run/Run Module and get an error: >> >> Syntax error, w

Re: Invalid syntax with print "Hello World"

2013-11-14 Thread bob gailer
On 11/14/2013 10:05 AM, johannes.gun...@gmail.com wrote: Am Donnerstag, 12. März 2009 07:57:11 UTC+1 schrieb Henrik Bechmann: obviously total mewbiew: My first program in Python Windows print "Hello World" I assume you are running Python 3 in which case you need print("Hello World") -- Bob

Re: Invalid syntax with print "Hello World"

2013-11-14 Thread johannes . gunz97
Am Donnerstag, 12. März 2009 07:57:11 UTC+1 schrieb Henrik Bechmann: > obviously total mewbiew: > > My first program in Python Windows > > print "Hello World" > > I select Run/Run Module and get an error: > > Syntax error, with the closing quote highlighted. > > Tried with single quotes as wel

Re: Invalid syntax with print "Hello World"

2013-04-13 Thread andygong . happy
On Thursday, March 12, 2009 3:25:53 PM UTC+8, John Machin wrote: > On Mar 12, 5:57 pm, Henrik Bechmann wrote: > > obviously total mewbiew: > > > > My first program in Python Windows > > What is that you are callind "Python Windows"? What version of Python > are you running? > > 2.X: print "Hello

Re: Invalid syntax

2012-11-07 Thread Smaran Harihar
Thanks a lot guys. Seriously when u get stuck on such issues it really drives u nuts and that is when this awesome comes to the rescue. This python mailing list rocks. On Wed, Nov 7, 2012 at 4:31 PM, Roy Smith wrote: > In article , > Demian Brecht wrote: > > > On 2012-11-07, at 3:17 PM, Smara

Re: Invalid syntax

2012-11-07 Thread Roy Smith
In article , Demian Brecht wrote: > On 2012-11-07, at 3:17 PM, Smaran Harihar wrote: > > Any idea where am I going wrong? > > Looks like you're missing a closing parenthesis: What I find is useful in situations like this is to just let emacs auto-indent the code. When it starts indenting (o

Re: Invalid syntax

2012-11-07 Thread R. Michael Weylandt
On Wed, Nov 7, 2012 at 11:17 PM, Smaran Harihar wrote: > Hi guys, > > I am stuck in one of those non identifiable error location in the code. The > code keeps giving invalid syntax. This is my code. > > I am using the same code for another code and not sure why this is not > working. This is the t

Re: Invalid syntax

2012-11-07 Thread Demian Brecht
On 2012-11-07, at 3:17 PM, Smaran Harihar wrote: > Any idea where am I going wrong? Looks like you're missing a closing parenthesis: w.record(collection[i][0], MAT[0], TSD[0], AnnTMin[0], ANNPREC[0], float(collection[i][2]), float(collection[i][1]) should be w.record(collection[i][0], MAT[0]

Re: Invalid syntax error

2012-03-10 Thread Ian Kelly
On Sat, Mar 10, 2012 at 6:17 AM, Günther Dietrich wrote: > In article > <46758542-1bd6-43fe-8e80-bcf14b7d8...@pi6g2000pbc.googlegroups.com>, >  sl33k wrote: > >>I'm trying project euler problem 3 and I've hit the wall with this >>error. What could be the problem here? >> >> l=[] > num=6008514

Re: Invalid syntax error

2012-03-10 Thread Günther Dietrich
In article <46758542-1bd6-43fe-8e80-bcf14b7d8...@pi6g2000pbc.googlegroups.com>, sl33k wrote: >I'm trying project euler problem 3 and I've hit the wall with this >error. What could be the problem here? > > l=[] num=600851475143 i=1 while i<=num: >... if num%i==0: >...

Re: Invalid syntax error

2012-03-10 Thread liuerfire Wang
在 2012年3月10日星期六UTC+8下午8时34分35秒,sl33k写道: > I'm trying project euler problem 3 and I've hit the wall with this > error. What could be the problem here? > > l=[] > >>> num=600851475143 > >>> i=1 > >>> while i<=num: > ... if num%i==0: > ... l.append(i) > ... i+=1 > ... print max(l) >

Re: Invalid syntax error

2012-03-10 Thread Ahsan
Just checked my version. Its showing 2.6.5. >>> sys.version '2.6.5 (r265:79063, Apr 16 2010, 13:09:56) \n[GCC 4.4.3]' -- http://mail.python.org/mailman/listinfo/python-list

Re: Invalid syntax error

2012-03-10 Thread Vlastimil Brom
2012/3/10 sl33k : > I'm trying project euler problem 3 and I've hit the wall with this > error. What could be the problem here? > >  l=[] num=600851475143 i=1 while i<=num: > ...     if num%i==0: > ...         l.append(i) > ...     i+=1 > ... print max(l) >  File "", line 5 >    prin

Re: Invalid syntax error

2012-03-10 Thread Andrew Berg
On 3/10/2012 6:34 AM, sl33k wrote: > I'm trying project euler problem 3 and I've hit the wall with this > error. What could be the problem here? > > l=[] num=600851475143 i=1 while i<=num: > ... if num%i==0: > ... l.append(i) > ... i+=1 > ... print max(l) > File "

Re: Invalid syntax error

2012-03-10 Thread Amit Sethi
Its an indentation error -- A-M-I-T S|S -- http://mail.python.org/mailman/listinfo/python-list

Re: Invalid Syntax Error

2010-01-14 Thread Benjamin Kaplan
How about you just isolate the first few lines On Thu, Jan 14, 2010 at 2:43 PM, Ray Holt wrote: > try: >     #open file stream >     file = open(file_name, "w" > except IOError: >     print "There was an error writing to", file_name >     sys.exit() Notice anything now? Something missing perhaps

Re: Invalid Syntax Error

2010-01-14 Thread MRAB
Ray Holt wrote: Why am I getting an invalid systax on the first except in the following code. It was copid from the python tutorial for beginners. Thanks, Ray import sys try: #open file stream file = open(file_name, "w" [snip] Missing ")". -- http://mail.python.org/mailman/listinfo/py

Re: Invalid syntax error

2009-12-20 Thread Todd A. Jacobs
On Sun, Dec 20, 2009 at 08:40:05AM -0500, Ray Holt wrote: > Why am I getting an invalid syntax error on the following: > os.chdir(c:\\Python_Modules). The error message says the colon after c You need to pass either a string literal or a variable. If you're passing a string, like you are trying t

Re: Invalid syntax error

2009-12-20 Thread D'Arcy J.M. Cain
On Sun, 20 Dec 2009 08:40:05 -0500 "Ray Holt" wrote: > Why am I getting an invalid syntax error on the following: > os.chdir(c:\\Python_Modules). The error message says the colon after c is You forgot the quotes around the string. I am not on Windows but I think the following will all work. os.

Re: Invalid syntax error

2009-12-20 Thread Xavier Ho
Putting quotemarks "" around the path would be a good start, I think. Cheers, Xav On Sun, Dec 20, 2009 at 11:40 PM, Ray Holt wrote: > Why am I getting an invalid syntax error on the following: > os.chdir(c:\\Python_Modules). The error message says the colon after c is > invalid syntax. Why is

Re: Invalid syntax with print "Hello World"

2009-03-12 Thread Luis Zarrabeitia
On Thursday 12 March 2009 07:45:55 am Dotan Cohen wrote: > I do not think that is the best way to go about learning Python. Why > learn an arguably depreciating version when the new version is > available. Because it is not only the language that matters, you also need the libraries to accomplis

Re: Invalid syntax with print "Hello World"

2009-03-12 Thread Henrik Bechmann
On Mar 12, 7:45 am, Dotan Cohen wrote: > > Welcome to the list.  As a newbie myself, I ran into the Python3 vrs > > 2.6 issue.  May I suggest starting with 2.6?  There is many more books > > and internet stuff you can learn with in 2.6 - and the examples will > > work. As Garry wrote, once you und

Re: Invalid syntax with print "Hello World"

2009-03-12 Thread Paul Boddie
On 12 Mar, 12:45, Dotan Cohen wrote: > [starting with 2.6] > I do not think that is the best way to go about learning Python. Why > learn an arguably depreciating version when the new version is > available. I agree that there are not many tutorial written for Python > 3 however there are enough

Re: Invalid syntax with print "Hello World"

2009-03-12 Thread Dotan Cohen
> Welcome to the list.  As a newbie myself, I ran into the Python3 vrs > 2.6 issue.  May I suggest starting with 2.6?  There is many more books > and internet stuff you can learn with in 2.6 - and the examples will > work. As Garry wrote, once you understand 2.6, 3.0 will not be a > challenge. > I

Re: Invalid syntax with print "Hello World"

2009-03-12 Thread steven.oldner
On Mar 12, 2:25 am, John Machin wrote: > On Mar 12, 5:57 pm, Henrik Bechmann wrote: > > > obviously total mewbiew: > > > My first program in Python Windows > > What is that you are callind "Python Windows"? What version of Python > are you running? > > 2.X: print "Hello World" > should work. > >

Re: Invalid syntax with print "Hello World"

2009-03-12 Thread John Machin
On Mar 12, 5:57 pm, Henrik Bechmann wrote: > obviously total mewbiew: > > My first program in Python Windows What is that you are callind "Python Windows"? What version of Python are you running? 2.X: print "Hello World" should work. 3.X: print is now a function, print("Hello World") should wor

Re: Invalid syntax with print "Hello World"

2009-03-12 Thread Daniel Fetchinson
> obviously total mewbiew: > > My first program in Python Windows > > print "Hello World" > > I select Run/Run Module and get an error: > > Syntax error, with the closing quote highlighted. > > Tried with single quotes as well. Same problem. > > Can someone explain my mistake? Are you using python

Re: Invalid syntax with print "Hello World"

2009-03-12 Thread Gary Herron
Henrik Bechmann wrote: obviously total mewbiew: My first program in Python Windows print "Hello World" I select Run/Run Module and get an error: Syntax error, with the closing quote highlighted. Tried with single quotes as well. Same problem. Can someone explain my mistake? You are app