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
Presumabl
> 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):
>
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, F
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:
http://stackoverflow.com/questions
urces richardkentish$
I installed the python files from the python site, latest version for mac.
Best wishes,
Richard
From: Steven D'Aprano
To: tutor@python.org
Sent: Sunday, 10 August 2014, 12:30
Subject: Re: [Tutor] Error message
On Sun, Aug 10, 201
help.
Best wishes,
Richard
From: RICHARD KENTISH
To: "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.
The code is taken
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
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))
pygame.display
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 also
I am attempting to run the following in python:
from scipy import interpolate
I receive this error message:
Traceback (most recent call last):
File "", line 1, in
File
"/Library/Python/2.7/site-packages/scipy-0.11.0.dev_0496569_20111005-py2.7-macosx-10.7-x86_64.egg/scipy/interpolate/__init
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
>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 wante
On 24/08/2012, Victoria Homsy 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 things too, probably
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 does
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
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
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
Excellent - thank you so much everyone. All is clear now!!
From: Mark Lawrence
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,
>
> Sorry to b
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) <= 1
On 23 August 2012 15:17, Victoria Homsy 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 function
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: retur
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')
How
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 o
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
Py
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. Thank
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
On Wed, Jun 11, 2008 at 2:25 AM, simone <[EMAIL PROTECTED]> wrote:
> Christopher Spears ha scritto:
>> Traceback (most recent call last):
>> File "", line 1, in ?
>> TypeError: Error when calling the metaclass bases
>>Cannot create a consistent method resolution
>> order (MRO) for bases B, A
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 (
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):
"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
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
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
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
>guess=rand
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
gues
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()
>
>
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 pr
> 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
h
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
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
I was wondering about that also, I've only ever used .group() when
I've got named groups using (?P)
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
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 "c
> 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
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()
>
> T
Ron Nixon wrote:
I'm dping something very simple in RE.
Lets say I'm trying to match an American Phone number
I write the code this way and try to match it:
import re
string = 'My phone is 410-995-1155'
pattern = r'\d{3}-\d{3}-\d{4}'
re.match(pattern,string).group()
Use re.search(). re.match() only
Try breaking it down to
> import re
> string = 'My phone is 410-995-1155'
> pattern = r'\d{3}-\d{3}-\d{4}'
x = re.match(pattern, string)
x.group()
See if that offers any improvement.
On Sun, 13 Feb 2005 17:01:33 -0800 (PST), Ron Nixon <[EMAIL PROTECTED]> wrote:
> I'm dping something very simpl
I'm dping something very simple in RE.
Lets say I'm trying to match an American Phone number
I write the code this way and try to match it:
import re
string = 'My phone is 410-995-1155'
pattern = r'\d{3}-\d{3}-\d{4}'
re.match(pattern,string).group()
but I get this error message
Traceback (most r
46 matches
Mail list logo