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-why I cannot run it, and I am so confused about the traceback

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

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

2010-04-07 Thread bob gailer
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. -- Bob Gailer 919-636-4239 Chapel Hill NC ___ Tutor maillist - Tutor@python.org To unsubscribe or cha

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 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) wrote: > > # Filename: classVolume.py > >

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 (1/3.0)*(ma

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) wrote: > # Filename: classVolume.py > # Demonstrates multiple classes per program. > > class Cube: >    """A class for cube shapes.""" >  

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

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 s

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 i

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

Re: [Tutor] ask

2010-02-24 Thread Kent Johnson
On Tue, Feb 23, 2010 at 10:58 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,

Re: [Tutor] ask

2010-02-24 Thread Alan Gauld
"Shurui Liu (Aaron Liu)" 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 write: range(10);

Re: [Tutor] ask

2010-02-23 Thread Benno Lang
On 24 February 2010 12:58, 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

Re: [Tutor] ask

2010-02-20 Thread Alan Gauld
"Shurui Liu (Aaron Liu)" 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 understand about

Re: [Tutor] ask

2010-02-19 Thread Andre Engels
On Sat, Feb 20, 2010 at 8:07 AM, Shurui Liu (Aaron Liu) 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, andreeng...@gmail.com _

Re: [Tutor] ask

2010-02-13 Thread Kent Johnson
2010/2/13 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

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 so

Re: [Tutor] ask

2010-02-13 Thread Kent Johnson
On Sat, Feb 13, 2010 at 4:08 PM, 刘书睿 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 run a prog

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 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 at function attributes

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 li

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] > >> > >>

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) o

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

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 aroun

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 Alan Gauld
"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. The easiest way is to call getattr() which will return a reference to the method if it exists. be r