[Tutor] ask-why I cannot run it, and I am so confused about the traceback

2010-04-07 Thread Shurui Liu (Aaron Liu)
# Filename: classVolume.py # Demonstrates multiple classes per program. class Cube: A class for cube shapes. def __init__(self, side): self.side = side def calculateArea(self): return (self.side)**3.0 class Sphere: A class for sphere shapes. def __init__(self,

Re: [Tutor] ask-why I cannot run it, and I am so confused about the traceback

2010-04-07 Thread Wesley Brooks
Morning, Your only supplying one argument to cone, when you need two: radius height. Cheers, Wesley Brooks. On 7 April 2010 11:56, Shurui Liu (Aaron Liu) shuru...@gmail.com wrote: # Filename: classVolume.py # Demonstrates multiple classes per program. class Cube:    A class for cube

Re: [Tutor] ask-why I cannot run it, and I am so confused about the traceback

2010-04-07 Thread Martin A. Brown
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Greetings, : class Cone: :A class for cone shapes. :def __init__(self, radius2, height): :self.radius2 = radius2 :self.height = height :def calculateArea(self): :import math :return

Re: [Tutor] ask-why I cannot run it, and I am so confused about the traceback

2010-04-07 Thread Shurui Liu (Aaron Liu)
Yes, I found it. thanks! On Wed, Apr 7, 2010 at 7:00 AM, Wesley Brooks wesbro...@gmail.com wrote: Morning, Your only supplying one argument to cone, when you need two: radius height. Cheers, Wesley Brooks. On 7 April 2010 11:56, Shurui Liu (Aaron Liu) shuru...@gmail.com wrote: #

Re: [Tutor] ask-why I cannot run it, and I am so confused about the traceback

2010-04-07 Thread Albert-Jan Roskam
, irrigation, roads, a fresh water system, and public health, what have the Romans ever done for us? ~~ --- On Wed, 4/7/10, bob gailer bgai...@gmail.com wrote: From: bob gailer bgai...@gmail.com Subject: Re: [Tutor] ask-why I cannot

Re: [Tutor] ask-why I cannot run it, and I am so confused about the traceback

2010-04-07 Thread Steven D'Aprano
On Wed, 7 Apr 2010 11:15:35 pm bob gailer wrote: You have the solution. Good. I beg you to avoid colored text. I find it hard to read. Just use good old plain text. No fancy fonts, sizes, colors. I don't see any of those. Can't you tell your mail client to ignore the rich text (HTML)

Re: [Tutor] ask

2010-03-28 Thread Shurui Liu (Aaron Liu)
You know what, I just don't understand this line: the name of the file containing the translated output is storyAmer.txt and it is to located. I don't know what kind of translated output he need. I guess: 1. the name of the file containing the translated output is * storyAmer.txt* and it

Re: [Tutor] ask

2010-03-28 Thread Emile van Sebille
On 3/28/2010 10:28 AM Shurui Liu (Aaron Liu) said... You know what, I just don't understand this line: the name of the file containing the translated output is storyAmer.txt and it is to located. It sounds to me like we wants you to read in the source(british) version, swap in the american

Re: [Tutor] ask

2010-03-28 Thread Shurui Liu (Aaron Liu)
I came out with a transigent answer: save the right text file*(storyAmer.txt *) at the right place /cset1100py/assign19/ storyAmer.txt. Then I just add a command after the command which picked out wrong words. I wanna add text_file = open(storyAmer.txt, r) But I don't know how to add its path in

Re: [Tutor] ask

2010-02-24 Thread Alan Gauld
Shurui Liu (Aaron Liu) shuru...@gmail.com wrote in message news:2b9003cf1002231958s34b701b6sc69408a0b855a...@mail.gmail.com... This time is not my assignment, I promise. In python, when we want to list numbers, we use the command range, like, if we want to list integer from 0 to 9, we can

Re: [Tutor] ask

2010-02-24 Thread Kent Johnson
On Tue, Feb 23, 2010 at 10:58 PM, Shurui Liu (Aaron Liu) shuru...@gmail.com wrote: This time is not my assignment, I promise. In python, when we want to list numbers, we use the command range, like, if we want to list integer from 0 to 9, we can write: range(10); if we want to list integer

Re: [Tutor] ask

2010-02-24 Thread Steven D'Aprano
On Wed, 24 Feb 2010 02:58:52 pm Shurui Liu (Aaron Liu) wrote: This time is not my assignment, I promise. In python, when we want to list numbers, we use the command range, like, if we want to list integer from 0 to 9, we can write: range(10); if we want to list integer from 10 to 29, we can

[Tutor] ask

2010-02-23 Thread Shurui Liu (Aaron Liu)
This time is not my assignment, I promise. In python, when we want to list numbers, we use the command range, like, if we want to list integer from 0 to 9, we can write: range(10); if we want to list integer from 10 to 29, we can write: range(10,30). I was going to show a list of number from 1.0

Re: [Tutor] ask

2010-02-23 Thread Benno Lang
On 24 February 2010 12:58, Shurui Liu (Aaron Liu) shuru...@gmail.com wrote: This time is not my assignment, I promise. In python, when we want to list numbers, we use the command range, like, if we want to list integer from 0 to 9, we can write: range(10); if we want to list integer from 10

Re: [Tutor] ask

2010-02-20 Thread Alan Gauld
Shurui Liu (Aaron Liu) shuru...@gmail.com wrote How to describe a math formula: sphere=(4/3)*PI*R**3? I'm not sure what you are asking? Shurui Liu (Aaron Liu) Computer Science Engineering Technology University of Toledo I assume from this that you have a basic knowledge of math so you

[Tutor] ask

2010-02-19 Thread Shurui Liu (Aaron Liu)
How to describe a math formula: sphere=(4/3)*PI*R**3? -- Shurui Liu (Aaron Liu) Computer Science Engineering Technology University of Toledo ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options:

Re: [Tutor] ask

2010-02-19 Thread Andre Engels
On Sat, Feb 20, 2010 at 8:07 AM, Shurui Liu (Aaron Liu) shuru...@gmail.com wrote: How to describe a math formula: sphere=(4/3)*PI*R**3? A function seems like the logical thing to do: import math def spherical_volume(radius): return (4.0/3)*math.pi*radius**3 -- André Engels,

[Tutor] ask

2010-02-13 Thread 刘书睿
Here are my assignment about Python, I don't know if anything is wrong. Is there anybody can help me? 1. assignment 9a and 9b hyperlink: http://cset.sp.utoledo.edu/cset1100py/cset1100_assign.html#simplepy 2. I don't know how to run a program in putty.exe, who knows? Cause i don't know the

Re: [Tutor] ask

2010-02-13 Thread Kent Johnson
On Sat, Feb 13, 2010 at 4:08 PM, 刘书睿 shuru...@gmail.com wrote: Here are my assignment about Python, I don't know if anything is wrong. Is there anybody can help me? 1. assignment 9a and 9b hyperlink: http://cset.sp.utoledo.edu/cset1100py/cset1100_assign.html#simplepy 2. I don't know how to

Re: [Tutor] ask

2010-02-13 Thread Shurui Liu (Aaron Liu)
Yeah, i know. I don't want somebody tell me all the answers of these assignment directly. I just want to know is there any error in the commands listed online? My teacher told us there is some, but I cannot find out. He said we can run them on putty.exe as soon as we fix the errors. I have found

Re: [Tutor] ask

2010-02-13 Thread Kent Johnson
2010/2/13 Shurui Liu (Aaron Liu) shuru...@gmail.com: Yeah, i know. I don't want somebody tell me all the answers of these assignment directly. I just want to know is there any error in the commands listed online? My teacher told us there is some, but I cannot find out. He said we can run them

Re: [Tutor] Ask a class for it's methods

2008-12-15 Thread Kent Johnson
On Fri, Dec 12, 2008 at 6:06 PM, Shrutarshi Basu technorapt...@gmail.com wrote: Is there a way to ask an object for a list of it's methods (with argument requirements if possible)? Take a look at the inspect module. If it does not directly give you what you need, look at the source - it looks

Re: [Tutor] Ask a class for it's methods

2008-12-13 Thread Lie Ryan
On Sat, 13 Dec 2008 02:59:34 +0100, Andreas Kostyrka wrote: On Fri, Dec 12, 2008 at 06:06:35PM -0500, Shrutarshi Basu wrote: I have a list containing strings like : func1[] func2[1,2] func3[blah] I want to turn them into method calls (with numeric or string arguments) on a supplied

Re: [Tutor] Ask a class for it's methods

2008-12-13 Thread Andreas Kostyrka
On Sat, Dec 13, 2008 at 08:03:10AM +, Lie Ryan wrote: On Sat, 13 Dec 2008 02:59:34 +0100, Andreas Kostyrka wrote: On Fri, Dec 12, 2008 at 06:06:35PM -0500, Shrutarshi Basu wrote: I have a list containing strings like : func1[] func2[1,2] func3[blah] I want to turn them

Re: [Tutor] Ask a class for it's methods

2008-12-13 Thread Lie Ryan
On Sat, 13 Dec 2008 10:19:34 +0100, Andreas Kostyrka wrote: On Sat, Dec 13, 2008 at 08:03:10AM +, Lie Ryan wrote: On Sat, 13 Dec 2008 02:59:34 +0100, Andreas Kostyrka wrote: On Fri, Dec 12, 2008 at 06:06:35PM -0500, Shrutarshi Basu wrote: I have a list containing strings like :

[Tutor] Ask a class for it's methods

2008-12-12 Thread Shrutarshi Basu
I have a list containing strings like : func1[] func2[1,2] func3[blah] I want to turn them into method calls (with numeric or string arguments) on a supplied object. I'm trying to figure out the best way to do this. Since these lists could be very big, and the methods could be rather complex

Re: [Tutor] Ask a class for it's methods

2008-12-12 Thread Alan Gauld
Shrutarshi Basu technorapt...@gmail.com wrote I have a list containing strings like : func1[] func2[1,2] func3[blah] I want to turn them into method calls (with numeric or string arguments) on a supplied object. The easiest way is to call getattr() which will return a reference to the

Re: [Tutor] Ask a class for it's methods

2008-12-12 Thread Shrutarshi Basu
I normally would use exceptions, because I think exceptions are a great idea. But since the functions may be time-consuming graphics functions and the lists could easily be hundreds of such calls, I don't want the user to sit around for something that might fail. Of course, I'm just starting so my

Re: [Tutor] Ask a class for it's methods

2008-12-12 Thread Lie Ryan
On Fri, 12 Dec 2008 20:05:23 -0500, Shrutarshi Basu wrote: I normally would use exceptions, because I think exceptions are a great idea. But since the functions may be time-consuming graphics functions and the lists could easily be hundreds of such calls, I don't want the user to sit around

Re: [Tutor] Ask a class for it's methods

2008-12-12 Thread Andreas Kostyrka
On Fri, Dec 12, 2008 at 06:06:35PM -0500, Shrutarshi Basu wrote: I have a list containing strings like : func1[] func2[1,2] func3[blah] I want to turn them into method calls (with numeric or string arguments) on a supplied object. I'm trying to figure out the best way to do this. Since