Re: [Tutor] Syntax error while attempting to type in multiline statements in the interactive interpreter

2017-02-05 Thread Alan Gauld via Tutor
On 05/02/17 01:29, boB Stepp wrote: > But it seems to me on further thought that both REPL and what seems > most consistent to me, "...wait until all the input has been read, > then evaluate it all..." amounts to the same thing in the case of > entering function definitions into the interpreter.

Re: [Tutor] Syntax error while attempting to type in multiline statements in the interactive interpreter

2017-02-04 Thread boB Stepp
I'm beginning to believe I am being incredibly dense today ... On Sat, Feb 4, 2017 at 6:16 PM, Ben Finney wrote: > boB Stepp writes: > >> But would it not be more consistent to assume the user knows what he >> is doing based on the new (lack of) indentation being used, accept >> that a new secti

Re: [Tutor] Syntax error while attempting to type in multiline statements in the interactive interpreter

2017-02-04 Thread Ben Finney
boB Stepp writes: > But would it not be more consistent to assume the user knows what he > is doing based on the new (lack of) indentation being used, accept > that a new section of code outside of the for loop is being typed in, > and wait for the blank line before executing everything typed in?

Re: [Tutor] Syntax error while attempting to type in multiline statements in the interactive interpreter

2017-02-04 Thread boB Stepp
On Sat, Feb 4, 2017 at 5:44 PM, Alan Gauld via Tutor wrote: > On 04/02/17 22:56, boB Stepp wrote: >> On Sat, Feb 4, 2017 at 4:40 PM, David wrote: >>> On 5 February 2017 at 09:02, boB Stepp wrote: py3: a ['Mary', 'had', 'a', 'little', 'lamb', 'break'] py3: for w in a: ...

Re: [Tutor] Syntax error while attempting to type in multiline statements in the interactive interpreter

2017-02-04 Thread Alan Gauld via Tutor
On 04/02/17 22:56, boB Stepp wrote: > On Sat, Feb 4, 2017 at 4:40 PM, David wrote: >> On 5 February 2017 at 09:02, boB Stepp wrote: >>> py3: a >>> ['Mary', 'had', 'a', 'little', 'lamb', 'break'] >>> py3: for w in a: >>> ... print(w) >>> ... print('Huh?') >>> File "", line 3 >>> print('H

Re: [Tutor] Syntax error while attempting to type in multiline statements in the interactive interpreter

2017-02-04 Thread David
On 5 February 2017 at 09:56, boB Stepp wrote: > On Sat, Feb 4, 2017 at 4:40 PM, David wrote: >>> >>> I don't understand why this throws a SyntaxError. If I wrap >>> essentially the same code into a function it works: >> >> From [1]: "When a compound statement is entered interactively, it must >>

Re: [Tutor] Syntax error while attempting to type in multiline statements in the interactive interpreter

2017-02-04 Thread boB Stepp
On Sat, Feb 4, 2017 at 4:40 PM, David wrote: > On 5 February 2017 at 09:02, boB Stepp wrote: >> py3: a >> ['Mary', 'had', 'a', 'little', 'lamb', 'break'] >> py3: for w in a: >> ... print(w) >> ... print('Huh?') >> File "", line 3 >> print('Huh?') >> ^ >> SyntaxError: invalid syn

Re: [Tutor] Syntax error while attempting to type in multiline statements in the interactive interpreter

2017-02-04 Thread David
On 5 February 2017 at 09:02, boB Stepp wrote: > py3: a > ['Mary', 'had', 'a', 'little', 'lamb', 'break'] > py3: for w in a: > ... print(w) > ... print('Huh?') > File "", line 3 > print('Huh?') > ^ > SyntaxError: invalid syntax > > I don't understand why this throws a SyntaxError.

[Tutor] Syntax error while attempting to type in multiline statements in the interactive interpreter

2017-02-04 Thread boB Stepp
py3: a ['Mary', 'had', 'a', 'little', 'lamb', 'break'] py3: for w in a: ... print(w) ... print('Huh?') File "", line 3 print('Huh?') ^ SyntaxError: invalid syntax I don't understand why this throws a SyntaxError. If I wrap essentially the same code into a function it works: py3

Re: [Tutor] syntax error help

2016-08-26 Thread Alan Gauld via Tutor
On 30/03/16 19:05, Awais Mamoon wrote: > Hi my code should be working however keeps coming up with invalid syntax but > I know there isn’t one. You are wrong. There is. I suspect the error message tells you where it is. In future please include the full error message with your code. Look closely

Re: [Tutor] syntax error help

2016-08-26 Thread David Rock
> On Mar 30, 2016, at 13:05, Awais Mamoon wrote: > > Hi my code should be working however keeps coming up with invalid syntax but > I know there isn’t one. Please help me its been 2 hours > When you run your code, what is the actual error you get (copy and paste the entire thing, please)? Wh

[Tutor] syntax error help

2016-08-26 Thread Awais Mamoon
Hi my code should be working however keeps coming up with invalid syntax but I know there isn’t one. Please help me its been 2 hours Here is my code: alphabet = 'abcdefghijklmnaopqrstuvwxyz' #gets the message from the user so it can Encrypt or Decrypt def getMessage(): prin

Re: [Tutor] Syntax error

2016-01-07 Thread Cameron Simpson
On 07Jan2016 13:15, Sarah Rasco wrote: Alan - I realized I did that right after I sent this email. However, I can't run it in the windows or python prompts. Here is my document: [image: Inline image 1] When I try to run it in the windows prompt I get: [image: Inline image 2] [...] Hi Sarah,

Re: [Tutor] Syntax error

2016-01-07 Thread Sarah Rasco
Alan - I realized I did that right after I sent this email. However, I can't run it in the windows or python prompts. Here is my document: [image: Inline image 1] When I try to run it in the windows prompt I get: [image: Inline image 2] Or in the python prompt: [image: Inline image 3] And the fi

Re: [Tutor] Syntax error

2016-01-07 Thread richard kappler
Hi Sarah! instead of 'python hello.py', try >>>import hello.py using python hello.py works from the Linux command line (presumably Windows as well) and it starts python then runs the hello.py script. From within the python interpreter, you import the file and it executes. HTH, Richard On Thu,

Re: [Tutor] Syntax error

2016-01-07 Thread Alan Gauld
On 07/01/16 13:40, Sarah Rasco wrote: > In IDLE, I typed print ("Hello, world!") and hit enter, and it returned the > message. I saved the file as hello.py in C:\python. Then, when I tried to > run it in IDLE, I got a syntax error and it highlighted the '5' in the > prompt 'python 3.5.1'. I suspe

[Tutor] Syntax error

2016-01-07 Thread Sarah Rasco
Hello, I'm new to programming and was told that Python would be a good language to start with. I downloaded version 3.5.1, and I have Windows 10. In IDLE, I typed print ("Hello, world!") and hit enter, and it returned the message. I saved the file as hello.py in C:\python. Then, when I tried to r

Re: [Tutor] syntax error

2015-09-18 Thread Nym City via Tutor
-Perfect. Thank you. On Tuesday, September 15, 2015 5:00 AM, Alan Gauld wrote: On 15/09/15 02:41, Nym City via Tutor wrote: > Hello, > I am also just trying to understand this code and could not understand the > print statement.I would have just used: >  print('cost:$',gross_cost

Re: [Tutor] syntax error

2015-09-15 Thread Alan Gauld
On 15/09/15 02:41, Nym City via Tutor wrote: Hello, I am also just trying to understand this code and could not understand the print statement.I would have just used: print('cost:$',gross_cost) Do you mind telling little bit about what: print('cost: ${:.2f}'.format(gross_cost)) does do and why

Re: [Tutor] Syntax error and EOL Error

2015-09-15 Thread Nym City via Tutor
-Thank you very much for your feedback. It was definitely helpful. I will try to stay consistent with my coding style in the future projects.   On Sunday, September 13, 2015 3:01 PM, Danny Yoo wrote: On Sun, Sep 13, 2015 at 7:20 AM, Nym City via Tutor wrote: > Hello, > Sorry fo

Re: [Tutor] syntax error

2015-09-15 Thread Nym City via Tutor
Hello, I am also just trying to understand this code and could not understand the print statement.I would have just used: print('cost:$',gross_cost) Do you mind telling little bit about what: print('cost: ${:.2f}'.format(gross_cost)) does do and why one would use this over my plain version?  T

Re: [Tutor] syntax error

2015-09-14 Thread Alan Gauld
On 14/09/15 19:25, Joel Goldstick wrote: On Mon, Sep 14, 2015 at 1:20 PM, Sarah wrote: Hi What's wrong with the following code? def main() lunch = int(input('How many hours did you eat?')) cost = float(input('Enter the hourly cost: ')) gross_cost = lunch * cost

Re: [Tutor] syntax error

2015-09-14 Thread Steven D'Aprano
On Mon, Sep 14, 2015 at 01:20:55PM -0400, Sarah wrote: > Hi > What's wrong with the following code? > > def main() >lunch = int(input('How many hours did you eat?')) >cost = float(input('Enter the hourly cost: ')) >gross_cost = lunch * cost >print('cost:$', format(c

Re: [Tutor] syntax error

2015-09-14 Thread Joel Goldstick
On Mon, Sep 14, 2015 at 1:20 PM, Sarah wrote: > Hi > What's wrong with the following code? > > def main() >lunch = int(input('How many hours did you eat?')) >cost = float(input('Enter the hourly cost: ')) >gross_cost = lunch * cost >print('cost:$', format(cost, '.2

[Tutor] syntax error

2015-09-14 Thread Sarah
Hi What's wrong with the following code? def main() lunch = int(input('How many hours did you eat?')) cost = float(input('Enter the hourly cost: ')) gross_cost = lunch * cost print('cost:$', format(cost, '.2f'), sep='') main() I get the error File "", line 6 Thanks,

Re: [Tutor] Syntax error and EOL Error

2015-09-13 Thread Danny Yoo
On Sun, Sep 13, 2015 at 7:20 AM, Nym City via Tutor wrote: > Hello, > Sorry for the late response. It took me sometime to find the solution. Below > is my updated code which seems to be working fine now. Just wanted to share > with the group here. > > import csv > DomainList = [] > > domains = o

Re: [Tutor] Syntax error and EOL Error

2015-09-13 Thread Nym City via Tutor
Hello, Sorry for the late response. It took me sometime to find the solution. Below is my updated code which seems to be working fine now. Just wanted to share with the group here. import csv DomainList = [] domains = open('domainlist.csv', 'r') DomainList = csv.reader(domains) DomainList = [co

Re: [Tutor] Syntax error and EOL Error

2015-09-07 Thread Alan Gauld
On 07/09/15 01:40, Nym City via Tutor wrote: Hello, Thank you for your response. I have made updates and here is the new code: import csv DomainList = [] domains = open('domainlist.csv', 'rb') DomainList = csv.reader(domains) DomainList = [column[1] for column in DomainList(str.rstrip('/'))] S

Re: [Tutor] Syntax error and EOL Error

2015-09-07 Thread Nym City via Tutor
Hello, Thank you for your response. I have made updates and here is the new code: import csv DomainList = [] domains = open('domainlist.csv', 'rb') DomainList = csv.reader(domains) DomainList = [column[1] for column in DomainList(str.rstrip('/'))] print(DomainList) For "DomainList = [column[1] for

Re: [Tutor] Syntax error and EOL Error

2015-09-04 Thread Peter Otten
Nym City via Tutor wrote: > import csv > DomainList = [] > > domains = open('domainlist.csv', 'r') > DomainList = csv.reader(domains) > DomainList = [column[1] for column in DomainList] > DomainList = (str(DomainList).rstrip('/') > print('\n'.join(DomainList)) > > > I keep getting EOL error on

[Tutor] Syntax error and EOL Error

2015-09-03 Thread Nym City via Tutor
Hello, I am working with a csv file that has following sample data: Rank    URL    Linking Root Domains 1    facebook.com/    9616487 2    twitter.com/    6454936 3    google.com/    5868081 4    youtube.com/    5442206 5    wordpress.org/    4051288 In my program, I am reading in this csv file, t

Re: [Tutor] syntax error with raw input

2014-11-12 Thread Steven D'Aprano
On Wed, Nov 12, 2014 at 04:38:51PM +0530, Vaibhav Banait wrote: > Hi > I am new to python. I learnt (!) using raw_input a day back. Attempt to > use has resulted in error. I am not able to spot a problem in syntax. What makes you think it is a problem with syntax? This is what happens when you h

Re: [Tutor] syntax error with raw input

2014-11-12 Thread wesley chun
Slightly hijacking this thread a bit, specifically Alan's reply, if anyone is averse to installing multiple versions of Python on their computers, you can always access a Python interpreter from a browser window. Here are a collection I've put together. Most are Python 2, but the top pair also sup

Re: [Tutor] syntax error with raw input

2014-11-12 Thread Alan Gauld
On 12/11/14 11:08, Vaibhav Banait wrote: Hi I am new to python. I learnt (!) using raw_input a day back. Attempt to use has resulted in error. I am not able to spot a problem in syntax. I am using python 3.4.2. Kindly help Looks like you are reading a v2 book/tutorial but using v3. In v3 seve

Re: [Tutor] syntax error with raw input

2014-11-12 Thread Chris Warrick
On Wed, Nov 12, 2014 at 12:08 PM, Vaibhav Banait wrote: > Hi > I am new to python. I learnt (!) using raw_input a day back. Attempt to use > has resulted in error. I am not able to spot a problem in syntax. I am using > python 3.4.2. Kindly help > > > a = raw_input("Write down your name: ") > > O

[Tutor] syntax error with raw input

2014-11-12 Thread Vaibhav Banait
Hi I am new to python. I learnt (!) using raw_input a day back. Attempt to use has resulted in error. I am not able to spot a problem in syntax. I am using python 3.4.2. Kindly help a = raw_input("Write down your name: ") Output: Traceback (most recent call last): File "", line 1, in a

Re: [Tutor] syntax error when attempting simple urllib.request.urlopen item

2013-07-10 Thread Dave Angel
On 07/09/2013 04:00 PM, Paul Smith wrote: Tutor- Ok newbie to coding here attempting to build controlled web scraper and have followed several books-tutorials and am failing at step one. This is the 3.3.1 code I am trying to run.. === import urllib.request htmltext = urllib.request.urlopen("ht

Re: [Tutor] syntax error when attempting simple urllib.request.urlopen item

2013-07-10 Thread Hugo Arts
On Tue, Jul 9, 2013 at 10:00 PM, Paul Smith wrote: > Tutor- > > Ok newbie to coding here attempting to build controlled web scraper and > have followed several books-tutorials and am failing at step one. > > This is the 3.3.1 code I am trying to run.. > === > import urllib.request > > htmltext = u

[Tutor] syntax error when attempting simple urllib.request.urlopen item

2013-07-10 Thread Paul Smith
Tutor- Ok newbie to coding here attempting to build controlled web scraper and have followed several books-tutorials and am failing at step one. This is the 3.3.1 code I am trying to run.. === import urllib.request htmltext = urllib.request.urlopen("http://google.com";).read print htmltext ===

Re: [Tutor] syntax error

2012-05-14 Thread bob gailer
On 5/14/2012 6:14 AM, Keitaro Kaoru wrote: hello~ is NOT a good subject i resent it but if that doesnt work. cause i sent it to myself also looks fine on my gmail.. but heres a link to pastebin http://pastebin.com/Jp7VJKGB There are still numerous errors that prevent the program from compili

Re: [Tutor] syntax error

2012-05-14 Thread bob gailer
I have changed the subject to "syntax error". Please always post a meaningful subject. On 5/14/2012 5:58 AM, Keitaro Kaoru wrote: sorry if i keep missing this up. hey. Austin here for some reason this command. all it does it produces the error message at the bottom.. The code you sent has num

Re: [Tutor] syntax error

2012-05-13 Thread Alan Gauld
On 13/05/12 10:44, Steven D'Aprano wrote: and if I look at the email which started this thread, Keitaro Kaoru's email with no subject line, I see it has the same message ID: Message-ID: so my guess is that Thunderbird is just stupid. Like Dave I am on Thunderbird 12 and it is threading the

Re: [Tutor] syntax error

2012-05-13 Thread Devin Jeanpierre
On Sun, May 13, 2012 at 5:44 AM, Steven D'Aprano wrote: > Devin Jeanpierre wrote: >> >> On Sat, May 12, 2012 at 10:29 PM, bob gailer wrote: >>> >>> oh - and always provide a specific meaningful subject >> >> >> My client has no idea what thread this post came from. >> >> Is it supposed to? > > >

Re: [Tutor] syntax error

2012-05-13 Thread Dave Angel
On 05/13/2012 05:44 AM, Steven D'Aprano wrote: > Devin Jeanpierre wrote: >> On Sat, May 12, 2012 at 10:29 PM, bob gailer wrote: >>> oh - and always provide a specific meaningful subject >> >> My client has no idea what thread this post came from. >> >> Is it supposed to? > > > What's your client?

Re: [Tutor] syntax error

2012-05-13 Thread Steven D'Aprano
Devin Jeanpierre wrote: On Sat, May 12, 2012 at 10:29 PM, bob gailer wrote: oh - and always provide a specific meaningful subject My client has no idea what thread this post came from. Is it supposed to? What's your client? I'm using Thunderbird, and it too doesn't have any idea. I see t

Re: [Tutor] syntax error

2012-05-12 Thread Devin Jeanpierre
On Sat, May 12, 2012 at 10:29 PM, bob gailer wrote: > oh - and always provide a specific meaningful subject My client has no idea what thread this post came from. Is it supposed to? -- Devin ___ Tutor maillist - Tutor@python.org To unsubscribe or ch

Re: [Tutor] syntax error

2012-05-12 Thread bob gailer
oh - and always provide a specific meaningful subject -- Bob Gailer 919-636-4239 Chapel Hill NC ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Syntax error help

2012-03-31 Thread S.Irfan Rizvi
Its failing i can't able to unsubcribe please remove me from its not going to Span either *Error: **Authentication failed.*Tutor list: member options login pageIn order to change your membership option, you must first log in by giving your email address

Re: [Tutor] Syntax error help

2012-03-31 Thread Alan Gauld
On 31/03/12 03:33, S.Irfan Rizvi wrote: Please remove me from listi can't do itthey are doing it Attention ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor Onl

Re: [Tutor] Syntax error help

2012-03-31 Thread bob gailer
Thank you for posting your code. Did you forget to reply-all? I am copying this to the list this time. You apparantly misunderstood my question about what you do to run the program. You said " I import then call the first function (the displaymenu) or I have it called in the code it does it a

Re: [Tutor] Syntax error help

2012-03-30 Thread S.Irfan Rizvi
Please remove me from listi can't do itthey are doing it Attention On Mar 30, 2012 9:21 PM, "bob gailer" wrote: > Please always reply-all so a copy goes to the list. > > On 3/30/2012 8:01 PM, chris knarvik wrote: > >> that was incomplete it was supposed to be ive fixed most of my problems

Re: [Tutor] Syntax error help

2012-03-30 Thread bob gailer
Please always reply-all so a copy goes to the list. On 3/30/2012 8:01 PM, chris knarvik wrote: that was incomplete it was supposed to be ive fixed most of my problems with your help That's great. Would you post the correct program so we can all learn? And possibly make other helpful suggestio

Re: [Tutor] Syntax error help

2012-03-30 Thread bob gailer
On 3/30/2012 6:20 PM, x23ch...@gmail.com wrote: Thanks I've fixed Great. Please share with us your new program and tell us what you do to run it. -- Bob Gailer 919-636-4239 Chapel Hill NC ___ Tutor maillist - Tutor@python.org To unsubscribe or cha

Re: [Tutor] Syntax error help

2012-03-30 Thread x23ch...@gmail.com
Thanks I've fixed Sent from my iPod On Mar 30, 2012, at 5:30 PM, bob gailer wrote: > On 3/30/2012 4:26 PM, chris knarvik wrote: >> Alright i have been trying to right a (relatively) simple to calculate area >> and volume below is my current working code > > Suggestion: start with a VERY SIMPL

Re: [Tutor] Syntax error help

2012-03-30 Thread Modulok
On 3/30/12, chris knarvik wrote: > Alright i have been trying to right a (relatively) simple to calculate area > and volume below is my current working code > def areamenu(): > print 'Square (1)' > print 'triangle (2)' > print 'rectangle (3)' > print 'trapazoid (4)' > print 'ci

Re: [Tutor] Syntax error help

2012-03-30 Thread bob gailer
On 3/30/2012 4:26 PM, chris knarvik wrote: Alright i have been trying to right a (relatively) simple to calculate area and volume below is my current working code Suggestion: start with a VERY SIMPLE program and get that working. Then add one new feature at a time. Is the following in Area.p

Re: [Tutor] Syntax error help

2012-03-30 Thread Evert Rol
> Alright i have been trying to right a (relatively) simple to calculate area > and volume below is my current working code > def areamenu(): > print 'Square (1)' > print 'triangle (2)' > print 'rectangle (3)' > print 'trapazoid (4)' > print 'circle (5)' > > def squareacalc():

[Tutor] Syntax error help

2012-03-30 Thread chris knarvik
Alright i have been trying to right a (relatively) simple to calculate area and volume below is my current working code def areamenu(): print 'Square (1)' print 'triangle (2)' print 'rectangle (3)' print 'trapazoid (4)' print 'circle (5)' def squareacalc(): sidelength = inp

Re: [Tutor] Syntax error with if statement

2011-08-24 Thread Andre Engels
On Wed, Aug 24, 2011 at 7:40 PM, Ray Parrish wrote: > Hello, > > I haven't been programming for a while and today I am working on something > and have encountered an error I cannot figure out. > > Here is my code: > > thisFile = column[6] > if thisFile == "/Images/My%20Face.JPG"

[Tutor] Syntax error with if statement

2011-08-24 Thread Ray Parrish
Hello, I haven't been programming for a while and today I am working on something and have encountered an error I cannot figure out. Here is my code: thisFile = column[6] if thisFile == "/Images/My%20Face.JPG" CallCount += 1 print CallCount

Re: [Tutor] syntax error that i cant spot!

2011-01-05 Thread Noah Hall
> > "Please" and "Thank you" are rude? Oh my, have you lived a sheltered life > :) > Nej, it was your condescension that I found rude. Also, you did it again, perhaps on purpose though.. ;) ___ Tutor maillist - Tutor@python.org To unsubscribe or change

Re: [Tutor] syntax error that i cant spot!

2011-01-05 Thread Steven D'Aprano
Noah Hall wrote: Please quote enough of the previous message to establish context -- when you are replying to the message, it is fresh in your mind. When others read your reply (possibly days later like I'm doing now), the context is anything but clear and your message comes across as merely mys

Re: [Tutor] syntax error that i cant spot!

2011-01-05 Thread Noah Hall
> > Please quote enough of the previous message to establish context -- when > you are replying to the message, it is fresh in your mind. When others read > your reply (possibly days later like I'm doing now), the context is anything > but clear and your message comes across as merely mysterious a

Re: [Tutor] syntax error that i cant spot!

2011-01-05 Thread Steven D'Aprano
Noah Hall wrote: He has no classes in there. Therefore, there is no place it should be in this code. Please remember this is Python, and not Java nor anything else. [...] It just makes life easier. Oh the irony... talking about making life easier, who are you talking to? What about? Please

Re: [Tutor] syntax error that i cant spot!

2011-01-02 Thread Wayne Werner
On Sun, Jan 2, 2011 at 9:52 AM, Alan Gauld wrote: > "Corey Richardson" wrote > > On Sat, Jan 1, 2011 at 9:10 PM, Alan Gauld >>> wrote: >>> Why avoidCamelCase? I actually prefer it to using_non_camel_case >>> >>> Python appears to use camelCase more than not. >>> >>> >> I tend to disag

Re: [Tutor] syntax error that i cant spot!

2011-01-02 Thread Ken Green
I generally prefer Camel Case as easily to use as it would be more difficult for me as a touch typist to hunt and peck for the underscore. Ken On 01/02/2011 09:40 AM, Brett Ritter wrote: On Sat, Jan 1, 2011 at 9:10 PM, Alan Gauld wrote: Why avoidCamelCase? I actually prefer it to using_non_c

Re: [Tutor] syntax error that i cant spot!

2011-01-02 Thread Alan Gauld
"Corey Richardson" wrote On Sat, Jan 1, 2011 at 9:10 PM, Alan Gauld wrote: Why avoidCamelCase? I actually prefer it to using_non_camel_case Python appears to use camelCase more than not. I tend to disagree with that. In the stdlib, as well as the builtins, many, many methods are alllow

Re: [Tutor] syntax error that i cant spot!

2011-01-02 Thread Corey Richardson
On 01/02/2011 09:40 AM, Brett Ritter wrote: > On Sat, Jan 1, 2011 at 9:10 PM, Alan Gauld wrote: >> Why avoidCamelCase? I actually prefer it to using_non_camel_case > > The readability is an often argued topic - I myself find the space of > names_in_underscores to be more readable (words are disti

Re: [Tutor] syntax error that i cant spot!

2011-01-02 Thread Hugo Arts
On Sun, Jan 2, 2011 at 3:40 PM, Brett Ritter wrote: > On Sat, Jan 1, 2011 at 9:10 PM, Alan Gauld wrote: >> Why avoidCamelCase? I actually prefer it to using_non_camel_case > > The readability is an often argued topic - I myself find the space of > names_in_underscores to be more readable (words a

Re: [Tutor] syntax error that i cant spot!

2011-01-02 Thread Brett Ritter
On Sat, Jan 1, 2011 at 9:10 PM, Alan Gauld wrote: > Why avoidCamelCase? I actually prefer it to using_non_camel_case The readability is an often argued topic - I myself find the space of names_in_underscores to be more readable (words are distinct), but I try to follow the common conventions of t

Re: [Tutor] syntax error that i cant spot!

2011-01-02 Thread Noah Hall
He has no classes in there. Therefore, there is no place it should be in this code. Please remember this is Python, and not Java nor anything else. To quote directly from PEP 8, in regards to functions and variables, "should be lowercase, with words separated by underscoresas necessary to improve

Re: [Tutor] syntax error that i cant spot!

2011-01-02 Thread Alan Gauld
"Noah Hall" wrote It's part of the Python naming conventions laid out by PEP 8. Have a read here - http://www.python.org/dev/peps/pep-0008/. I'm quite familiar with PEP8 - although I disagree with quite a lot of it too! But PEP 8 is about consistency of style not "readability" which was w

Re: [Tutor] syntax error that i cant spot!

2011-01-01 Thread Noah Hall
It's part of the Python naming conventions laid out by PEP 8. Have a read here - http://www.python.org/dev/peps/pep-0008/. Hope this helps. ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mail

Re: [Tutor] syntax error that i cant spot!

2011-01-01 Thread Alan Gauld
"Noah Hall" wrote By the way, for readability, tryToavoidCamelCase. Why avoidCamelCase? I actually prefer it to using_non_camel_case But it's been the standard in OOP languages since at least Smalltalk 80 (ie 1980) so I guess I'm just used to it... Alan G.

Re: [Tutor] syntax error that i cant spot!

2011-01-01 Thread Ken Green
He had no space between the plus sign and the name value and that threw me. I am so used to using a space before or after the plus sign. Ken On 01/01/2011 02:46 PM, bob gailer wrote: On 1/1/2011 2:28 PM, Ken Green wrote: I am caught off guard but what is the purpose of the plus sign? I don'

Re: [Tutor] syntax error that i cant spot!

2011-01-01 Thread Noah Hall
> > > I am caught off guard but what is the purpose of the plus sign? I don't > recall seeing it used like that. > The + sign there is used for concating two strings together, for example - output = 'foo' + 'bar' Will give the variable output the value of the characters 'foobar'. This also work

Re: [Tutor] syntax error that i cant spot!

2011-01-01 Thread bob gailer
On 1/1/2011 2:28 PM, Ken Green wrote: I am caught off guard but what is the purpose of the plus sign? I don't recall seeing it used like that. I just tried to look that up in the Python Manuals. No success! Where is it hiding? *** OOPS just found it in section 6.6 Sequence Types s + t the c

Re: [Tutor] syntax error that i cant spot!

2011-01-01 Thread bob gailer
On 1/1/2011 2:28 PM, Ken Green wrote: I am caught off guard but what is the purpose of the plus sign? I don't recall seeing it used like that. I just tried to look that up in the Python Manuals. No success! Where is it hiding? >>> a = 'a' >>> b = 'b' >>> c = a + b >>> print c ab Now you ca

Re: [Tutor] syntax error that i cant spot!

2011-01-01 Thread Corey Richardson
On 01/01/2011 02:28 PM, Ken Green wrote: I am caught off guard but what is the purpose of the plus sign? I don't recall seeing it used like that. Ken On 01/01/2011 12:11 PM, Abhijeet Rastogi wrote: You missed a "+" after myName on line 30. On Sat, Jan 1, 2011 at 10:32 PM, pete mailto:psmo...@

Re: [Tutor] syntax error that i cant spot!

2011-01-01 Thread Ken Green
I am caught off guard but what is the purpose of the plus sign? I don't recall seeing it used like that. Ken On 01/01/2011 12:11 PM, Abhijeet Rastogi wrote: You missed a "+" after myName on line 30. On Sat, Jan 1, 2011 at 10:32 PM, pete > wrote: Hi, Please

Re: [Tutor] syntax error that i cant spot!

2011-01-01 Thread David Hutto
You also can place: else: print " this is not a number" And: if guess == number: break if guess == number: guessesTaken = str(guessesTaken) print 'Good job, ' + myName + "! You guessed the number in " + guessesTaken + ' guesses!' which could be combined. if guess =

Re: [Tutor] syntax error that i cant spot!

2011-01-01 Thread Knacktus
Am 01.01.2011 18:02, schrieb pete: Hi, Please help just starting out and have come up with the following code to create a simple guessing game. on line 30 print good job etc i get a syntax error! sure it's simple but i've looked for ages and cant spot it! There's a + missing after myName Also,

Re: [Tutor] syntax error that i cant spot!

2011-01-01 Thread David Hutto
On Sat, Jan 1, 2011 at 12:02 PM, pete wrote: > Hi, > Please help just starting out and have come up with the following code to > create a simple guessing game. > > on line 30 print good job etc i get a syntax error! sure it's simple but > i've looked for ages and cant spot it! > > Regards > Pete

Re: [Tutor] syntax error that i cant spot!

2011-01-01 Thread Abhijeet Rastogi
You missed a "+" after myName on line 30. On Sat, Jan 1, 2011 at 10:32 PM, pete wrote: > Hi, > Please help just starting out and have come up with the following code to > create a simple guessing game. > > on line 30 print good job etc i get a syntax error! sure it's simple but > i've looked for

[Tutor] syntax error that i cant spot!

2011-01-01 Thread pete
Hi, Please help just starting out and have come up with the following code to create a simple guessing game. on line 30 print good job etc i get a syntax error! sure it's simple but i've looked for ages and cant spot it! Regards Pete # guess the number game import random guessesTaken = 0 p

Re: [Tutor] Syntax Error Messages

2010-10-22 Thread David Hutto
What my buddy pal is saying, is that you should start at the beginning. I first downloaded x version of python to x operating system, then I tried this tutorial with these explicit modules/requirements(which I may or not have) then progress to the smaller aspects, like this won't iterate, or that d

Re: [Tutor] Syntax Error Messages

2010-10-22 Thread Steven D'Aprano
On Sat, 23 Oct 2010 05:49:07 am Terry Green wrote: > I found this script when looking at the CVS module and loaded > It into PyScripter, but get: Syntax Error: Invalid Syntax > Cannot figure out why and Googleing for help doesn't help > > Any ideas? No, no, don't show us the actual error that you

Re: [Tutor] Syntax Error Messages

2010-10-22 Thread Hugo Arts
On Fri, Oct 22, 2010 at 8:49 PM, Terry Green wrote: > Am new to Python, and having difficulty with Error Messages > > I ‘m using Python 3.1 > > And PyScripter as my editor > > > > I want to process a comma delimited file one line at a time and > Interact with the fields within each line. > I found

[Tutor] Syntax Error Messages

2010-10-22 Thread Terry Green
Am new to Python, and having difficulty with Error Messages I 'm using Python 3.1 And PyScripter as my editor I want to process a comma delimited file one line at a time and Interact with the fields within each line. I found this script when looking at the CVS module and loaded It into PyS

Re: [Tutor] syntax error

2009-06-28 Thread Alan Gauld
"Christopher Altieri" wrote loaded python 3 and 3.1 several times on vista. tried first command: print "hello world' but keep getting syntax error. what am I doing wrong? Using Python 3 to learn Python! :-) Seriously, You would be better downgrading to Python 2.6 to learn because v3 has in

Re: [Tutor] syntax error

2009-06-25 Thread Christian Witts
Christopher Altieri wrote: loaded python 3 and 3.1 several times on vista. tried first command: print "hello world' but keep getting syntax error. what am I doing wrong? ___ Tu

[Tutor] syntax error

2009-06-25 Thread Christopher Altieri
loaded python 3 and 3.1 several times on vista. tried first command: print "hello world' but keep getting syntax error. what am I doing wrong? ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Syntax Error First Example

2009-06-11 Thread Kent Johnson
On Wed, Jun 10, 2009 at 10:02 PM, Randy Trahan wrote: > First, I am suppose to put this in the script mode vs the IDLE mode correct? > He failed to mention where.. Generally the "Python Shell" window is for interactive exploration and to see the results of your scripts. To type in a complete prog

Re: [Tutor] Syntax Error First Example

2009-06-10 Thread Lie Ryan
Randy Trahan wrote: > Hi, > Just opened the book Python Programming, Second Edition by Michael > Dawson and have my first question. Instead of the usual "Hello World" as > the first example he asked to type this: > > print "Game Over" > raw input("\n\nPress the enter key to exit.") > > First, I

Re: [Tutor] Syntax Error First Example

2009-06-10 Thread Wayne
On Wed, Jun 10, 2009 at 9:12 PM, bob gailer wrote: > Randy Trahan wrote: > >> First, I am suppose to put this in the script mode vs the IDLE mode >> correct? He failed to mention where.. > > It really doesn't matter - although presumably he meant you to write a script instead of in the shell/int

Re: [Tutor] Syntax Error First Example

2009-06-10 Thread bob gailer
Randy Trahan wrote: Hi, Just opened the book Python Programming, Second Edition by Michael Dawson and have my first question. Instead of the usual "Hello World" as the first example he asked to type this: print "Game Over" raw input("\n\nPress the enter key to exit.") Try raw_input("\n\nPr

[Tutor] Syntax Error First Example

2009-06-10 Thread Randy Trahan
Hi, Just opened the book Python Programming, Second Edition by Michael Dawson and have my first question. Instead of the usual "Hello World" as the first example he asked to type this: print "Game Over" raw input("\n\nPress the enter key to exit.") First, I am suppose to put this in the script mo

Re: [Tutor] Syntax error

2009-03-23 Thread John Jenkinson
I am using Python 2.4.1. I am using the IDLE process, and I was not saving as ".py". Thank you, everyone, for your continued help. On Mon, Mar 23, 2009 at 3:35 AM, Alan Gauld wrote: > > "John Jenkinson" wrote > > I am trying to write a program that displays the string expression "Game >> Over

Re: [Tutor] Syntax error

2009-03-23 Thread Alan Gauld
"John Jenkinson" wrote I am trying to write a program that displays the string expression "Game Over", in a console window that remains open. print "Game Over" raw input("\n\nPress the enter key to exit.") I dont understand what is supposed to happen if the code were to be correct. Would a

Re: [Tutor] Syntax error

2009-03-22 Thread John Jenkinson
I understand. I am following a tutorial that has a typo. Quoting from the text: The last line of the program: raw input("\n\nPress the enter key to exit.") I enjoyed your intuitive explanation, thank you. On Sun, Mar 22, 2009 at 11:30 PM, Marc Tompkins wrote: > On Sun, Mar 22, 2009 at 8:35 P

  1   2   >