Re: [Tutor] error message

2019-03-21 Thread Alan Gauld via Tutor
On 21/03/19 05:13, Glenn Dickerson wrote: Thank you for all of your responses to: class Student(): def__init__(self, name, major, gpa, is_on_probation): self.name = name self.major = major self.gpa = gpa self.is_on_probation = is_on_probation

Re: [Tutor] error message

2019-03-21 Thread Steven D'Aprano
> I don't understand this error message. Thank you so much, Glenn Dickerson > > Traceback (most recent call last): > File "/home/glen/app.py", line 1, in > import Student > File "/home/glen/Student.py", line 2 > def__init__(self, name, major, gpa, is_on_probation): >

[Tutor] error message

2019-03-21 Thread Glenn Dickerson
Thank you for all of your responses to: class Student(): def__init__(self, name, major, gpa, is_on_probation): self.name = name self.major = major self.gpa = gpa self.is_on_probation = is_on_probation import Student student1 = Student('Jim', 'Business', 3.1,

Re: [Tutor] Error message

2014-08-11 Thread Danny Yoo
Hi Richard, I would recommend asking the PyGame folks on this one. What you're running into is specific to that external library, and folks who work with PyGame have encountered the problem before: they'll know how to diagnose and correct it. For example:

[Tutor] Error message

2014-08-10 Thread RICHARD KENTISH
Hi! Ive installed Python 2.7.8 and pygame 1.9.1 onto a macbook pro 10.9.4 Mavericks. The code is taken direct from the 'making games' book. Here it is pasted from idle: import pygame, sys from pygame.locals import * pygame.init() displaysurf = pygame.dispaly.set_mode((400, 300))

Re: [Tutor] Error message

2014-08-10 Thread Steven D'Aprano
On Sun, Aug 10, 2014 at 10:32:52AM +0100, RICHARD KENTISH wrote: Hi! Ive installed Python 2.7.8 and pygame 1.9.1 onto a macbook pro 10.9.4 Mavericks. The code is taken direct from the 'making games' book. Here it is pasted from idle: Whenever you have a mysterious error in Python that

Re: [Tutor] Error message

2014-08-10 Thread RICHARD KENTISH
. Best wishes, Richard From: RICHARD KENTISH r.kent...@btinternet.com To: tutor@python.org tutor@python.org Sent: Sunday, 10 August 2014, 10:32 Subject: [Tutor] Error message Hi! Ive installed Python 2.7.8 and pygame 1.9.1 onto a macbook pro 10.9.4 Mavericks

Re: [Tutor] Error message

2014-08-10 Thread RICHARD KENTISH
$  I installed the python files from the python site, latest version for mac. Best wishes, Richard From: Steven D'Aprano st...@pearwood.info To: tutor@python.org Sent: Sunday, 10 August 2014, 12:30 Subject: Re: [Tutor] Error message On Sun, Aug 10, 2014 at 10

[Tutor] Error message received when running “from scipy import interpolate”

2014-06-05 Thread Colin Ross
I am attempting to run the following in python: from scipy import interpolate I receive this error message: Traceback (most recent call last): File stdin, line 1, in module File

Re: [Tutor] Error message received when running “from scipy import interpolate”

2014-06-05 Thread Alan Gauld
On 05/06/14 23:36, Colin Ross wrote: I am attempting to run the following in python: |from scipyimport interpolate| This list is for those learning the core Python language and its standard library. Support for scipy is probably best gained from the scipy forum The MacPython list may

Re: [Tutor] Error message...

2012-08-25 Thread Matthew Ngaha
Hi Victoria. im a total beginner aswell but i noticed something. shouldnt this line: else: return s(0) == s(-1) and isPalindrome (s[1:-1]) be else: return s[0] == s[-1] and isPalindrome (s[1:-1]) it looks like you have the string s as a function which you are trying to call. what you wanted

Re: [Tutor] Error message...

2012-08-25 Thread Victoria Homsy
Thank you everyone for your help with my question - I understand what I was doing wrong now. I know I'm posting wrongly so I'm going to go and figure out how to do it properly for the future. Have a great day. ___ Tutor maillist - Tutor@python.org To

Re: [Tutor] Error message...

2012-08-24 Thread David
On 24/08/2012, Victoria Homsy victoriaho...@yahoo.com wrote: However, this does not work - I get another error message. Could somebody advise what I'm doing wrong here? Thank you. 1) You are not carefully reading the entire error message. 2) You are not allowing us to do it either. Some other

[Tutor] Error message...

2012-08-23 Thread Victoria Homsy
Dear all,  Sorry to bother you with a beginner's problem again...  I have tried to write a program that can check if a string is a palindrome. My code is as follows: def isPalindrome(s): if len(s) = 1: return True else: return s(0) == s(-1) and isPalindrome (s[1:-1]) isPalindrome('aba')

Re: [Tutor] Error message...

2012-08-23 Thread Peter Otten
Victoria Homsy wrote: Sorry to bother you with a beginner's problem again... This is the place for beginners. I have tried to write a program that can check if a string is a palindrome. My code is as follows: def isPalindrome(s): if len(s) = 1: return True else: return s(0)

Re: [Tutor] Error message...

2012-08-23 Thread Rob Day
On 23 August 2012 15:17, Victoria Homsy victoriaho...@yahoo.com wrote: def isPalindrome(s): if len(s) = 1: return True else: return s(0) == s(-1) and isPalindrome (s[1:-1]) I don't see why this wouldn't work... Many thanks in advance. Kind regards, Victoria Parentheses are used for

Re: [Tutor] Error message...

2012-08-23 Thread Mark Lawrence
On 23/08/2012 15:17, Victoria Homsy wrote: Dear all, Sorry to bother you with a beginner's problem again... You're welcome as that's what we're here for. I have tried to write a program that can check if a string is a palindrome. My code is as follows: def isPalindrome(s): if len(s) =

Re: [Tutor] Error message...

2012-08-23 Thread Victoria Homsy
Excellent - thank you so much everyone. All is clear now!!  From: Mark Lawrence breamore...@yahoo.co.uk To: tutor@python.org Sent: Thursday, 23 August 2012, 15:29 Subject: Re: [Tutor] Error message... On 23/08/2012 15:17, Victoria Homsy wrote: Dear all

[Tutor] Error message...

2012-08-23 Thread Victoria Homsy
Dear All - sorry to bother you. I just tried to run this program: def isPalindrome(s): if len(s) = 1: return True  else: return s[0] == s[-1] and isPalindrome (s[1:-1]) isPalindrome('aba') However when I run it in terminal it doesn't give me any answer - True or False. (I want the program

Re: [Tutor] Error message...

2012-08-23 Thread Steven D'Aprano
On 24/08/12 01:33, Victoria Homsy wrote: Dear All - sorry to bother you. I just tried to run this program: def isPalindrome(s): if len(s)= 1: return True else: return s[0] == s[-1] and isPalindrome (s[1:-1]) isPalindrome('aba') However when I run it in terminal it doesn't give me any answer

Re: [Tutor] Error message...

2012-08-23 Thread Mark Lawrence
On 23/08/2012 16:33, Victoria Homsy wrote: Dear All - sorry to bother you. I just tried to run this program: def isPalindrome(s): if len(s) = 1: return True else: return s[0] == s[-1] and isPalindrome (s[1:-1]) isPalindrome('aba') However when I run it in terminal it doesn't give me any

Re: [Tutor] Error message...

2012-08-23 Thread Dave Angel
On 08/23/2012 11:33 AM, Victoria Homsy wrote: Dear All - sorry to bother you. I just tried to run this program: def isPalindrome(s): if len(s) = 1: return True else: return s[0] == s[-1] and isPalindrome (s[1:-1]) isPalindrome('aba') However when I run it in terminal it doesn't give me

[Tutor] error message

2009-07-08 Thread Steven Buck
I'm running a for loop which returns an error message after the third iteration (see out[4] at the bottom as evidence). I don't understand the error message. Although I'll continue to do my own digging to debug, I thought I'd give you all a shot. Thanks, -steve Python 2.6.2 (r262:71605, Apr 14

Re: [Tutor] error message

2009-07-08 Thread Emile van Sebille
On 7/8/2009 9:13 AM Steven Buck said... I'm running a for loop which returns an error message after the third iteration (see out[4] at the bottom as evidence). I don't understand the error message. Although I'll continue to do my own digging to debug, I thought I'd give you all a shot.

Re: [Tutor] error message

2009-07-08 Thread bob gailer
Steven Buck wrote: I'm running a for loop which returns an error message after the third iteration(see out[4] at the bottom as evidence). I don't understand the error message. Although I'll continue to do my own digging to debug, I thought I'd give you all a shot. Thanks, -steve Python

Re: [Tutor] error message

2009-07-08 Thread Steven Buck
As Bob prescribed, I added (and made sure to indent): print self._header['byteorder'], fmt, byt The fourth printed line appears to be the same: Out[4]: {0: 22, 1: 51, 2: 42} This is consistent with what I observe as the first three age observations in the Stata data editor. I include the rest

Re: [Tutor] error message with multiple inheritance

2008-06-11 Thread simone
Christopher Spears ha scritto: I've been working out of Core Python Programming (2nd Edition). Here is an example demonstrating multiple inheritance. class A(object): ... pass ... class B(A): ... pass ... class C(B): ... pass ... class D(A, B): ... pass ... Traceback

Re: [Tutor] error message with multiple inheritance

2008-06-11 Thread Kent Johnson
On Wed, Jun 11, 2008 at 2:25 AM, simone [EMAIL PROTECTED] wrote: Christopher Spears ha scritto: Traceback (most recent call last): File stdin, line 1, in ? TypeError: Error when calling the metaclass bases Cannot create a consistent method resolution order (MRO) for bases B, A What

[Tutor] error message with multiple inheritance

2008-06-10 Thread Christopher Spears
I've been working out of Core Python Programming (2nd Edition). Here is an example demonstrating multiple inheritance. class A(object): ... pass ... class B(A): ... pass ... class C(B): ... pass ... class D(A, B): ... pass ... Traceback (most recent call last): File stdin,

[Tutor] error message questions

2007-05-27 Thread adam urbas
Hello all,I was wondering if there would be someone who would be able to give me a list of error messages and their meanings. I've attached this test.py to illustrate my problem. When I run the program, I am able to enter all the data, yet it will not calculate.It says:can't multiply sequence

Re: [Tutor] error message questions

2007-05-27 Thread Rikard Bosnjakovic
On 5/27/07, adam urbas [EMAIL PROTECTED] wrote: It says: can't multiply sequence by non-int of type 'str' The reason is that raw_input() returns a string. What you are trying to do is multiply a string with a string, which - in Python - is an illegal operation. What you want to do is to

Re: [Tutor] error message questions

2007-05-27 Thread Alan Gauld
adam urbas [EMAIL PROTECTED] wrote in Hello all,I was wondering if there would be someone who would be able to give me a list of error messages and their meanings. The errors are actually self explanatory - no really! - once you undestandd the basic concepts. But to understand those you will

[Tutor] error message

2006-10-01 Thread mike viceano
hello i wrote a litle program ware you pick a number and the computer guesses it and i recently decided to make it so it dosint reguess numbers but now i get a error message here is the program def number(number): from random import randrange guess=randrange(number*2) print guess

Re: [Tutor] error message

2006-10-01 Thread Kent Johnson
mike viceano wrote: hello i wrote a litle program ware you pick a number and the computer guesses it and i recently decided to make it so it dosint reguess numbers but now i get a error message here is the program def number(number): from random import randrange

[Tutor] Error message with testing Tkinter

2005-11-07 Thread Double Six
Hi, I'm learning Tkinter with the following code on Mac OS X 10.4: from Tkinter import * from sys import stdout, exit widget = Button(None, text = 'Hello?', command=(lambda: stdout.write('Hello?\n') or exit())) widget.pack() widget.mainloop() I do successfully get a GUI with a button, but the

Re: [Tutor] Error message with testing Tkinter

2005-11-07 Thread Danny Yoo
On Mon, 7 Nov 2005, Double Six wrote: I'm learning Tkinter with the following code on Mac OS X 10.4: from Tkinter import * from sys import stdout, exit widget = Button(None, text = 'Hello?', command=(lambda: stdout.write('Hello?\n') or exit())) widget.pack() widget.mainloop() I do

Re: [Tutor] error message

2005-02-14 Thread Alan Gauld
The biggest problem that nobody has mentioned yet is the fact that group() will not have anything unless you explicitly tell it to group it. Nope, group will work OK even with a normal string regex. Alan G. ___ Tutor maillist - Tutor@python.org

Re: [Tutor] error message

2005-02-13 Thread Liam Clarke
OK, so it looks like you're not matching. Remember match only matches at the start of a line, so try re.search instead. On Sun, 13 Feb 2005 17:16:24 -0800 (PST), Ron Nixon [EMAIL PROTECTED] wrote: Got the same error message after trying: x =re.match(patt,string) x.group() Traceback

Re: [Tutor] error message

2005-02-13 Thread Alan Gauld
string = 'My phone is 410-995-1155' pattern = r'\d{3}-\d{3}-\d{4}' re.match(pattern,string).group() AttributeError: 'NoneType' object has no attribute 'group' When match doesn't find anything it returns None, which has no group() method. Why does it not find the regex? Because you used

Re: [Tutor] error message

2005-02-13 Thread Jacob S.
Dive into Python, an excellent tutorial has a case study on this very same topic. The biggest problem that nobody has mentioned yet is the fact that group() will not have anything unless you explicitly tell it to group it. I.E. pattern = r'(\d{3})-(\d{3})-(\d{4})' You need the parenthesis to

Re: [Tutor] error message

2005-02-13 Thread Liam Clarke
I was wondering about that also, I've only ever used .group() when I've got named groups using (?Pfoo) On Sun, 13 Feb 2005 21:04:22 -0500, Jacob S. [EMAIL PROTECTED] wrote: Dive into Python, an excellent tutorial has a case study on this very same topic. The biggest problem that nobody has

Re: [Tutor] error message

2005-02-13 Thread Kent Johnson
Jacob S. wrote: Dive into Python, an excellent tutorial has a case study on this very same topic. The biggest problem that nobody has mentioned yet is the fact that group() will not have anything unless you explicitly tell it to group it. group() defaults to returning group 0 which is the whole

Re: [Tutor] error message

2005-02-13 Thread Jacob S.
Okay... Cool. Jacob group() defaults to returning group 0 which is the whole match. import re string = 'My phone is 410-995-1155' pattern = r'\d{3}-\d{3}-\d{4}' re.search(pattern,string).group() '410-995-1155' Kent ___ Tutor maillist -