Re: [Tutor] faulty code (maths)

2008-11-23 Thread Lie Ryan
On Sun, 23 Nov 2008 19:39:54 +0530, Arun Tomar wrote: > hi! > > > On Sun, Nov 23, 2008 at 5:07 PM, David <[EMAIL PROTECTED]> wrote: >> Hello everybody, >> >> I recently came across a book by Prof. Langtangen: Indroduction to >> Computer Programming: >> http://folk.uio.no/hpl/INF1100/INF1100-eboo

Re: [Tutor] [Re: class/type methods/functions]

2008-11-23 Thread Eike Welk
Hey Spir! Maybe you should read the book "Design Patterns" from Erich Gamma and the rest of "the gang of four". (A.T.Hofkamp, mentioning its terminology, got me thinking.) You ask complicated questions that normal newbies don't ask, so you should maybe read an advanced book. The book's idea is

Re: [Tutor] faulty code (maths)

2008-11-23 Thread Kent Johnson
On Sun, Nov 23, 2008 at 9:44 AM, David <[EMAIL PROTECTED]> wrote: > The working code: > > a = 2; b = 1; c = 2 > import math > q = math.sqrt(math.fabs(b*b - 4*a*c)) > x1 = (-b + q)/2*a > x2 = (-b - q)/2*a > print x1, x2 Working in the sense of "completes without an error message and prints a resul

Re: [Tutor] faulty code (maths)

2008-11-23 Thread David
Hello, yes, that did the trick, though I had to change the "from math import ~" line to "import math". I also changed in line three the sqrt() function to math.sqrt(). Otherwise there would be complaints: : name 'sqrt' is not defined WARNING: Failure executing file: The working code: a = 2

Re: [Tutor] Size of Python Console

2008-11-23 Thread Wayne Watson
Title: Signature.html This then would seem to what I need in my case for the shortcut: c:\python25\python25.exe C:\Sandia_Meteors\New_Sentinel_Development\Development\Utility_Dev\SU_DateTimeAdjust.py (It's really a single line, but wrapped here and there is a space between to two path items.)

Re: [Tutor] faulty code (maths)

2008-11-23 Thread Arun Tomar
hi! On Sun, Nov 23, 2008 at 5:07 PM, David <[EMAIL PROTECTED]> wrote: > Hello everybody, > > I recently came across a book by Prof. Langtangen: Indroduction to Computer > Programming: http://folk.uio.no/hpl/INF1100/INF1100-ebook-Aug08.pdf > > I am trying to solve exercise 1.18 ("Why does the foll

Re: [Tutor] faulty code (maths)

2008-11-23 Thread David
Hello Kent, yes, the error message - sorry: When I just run line 3, I get: In [7]: q = sqrt(b*b - 4*a*c) ...: --- Traceback (most recent call last) /home/david/Documents/Python/myCode/Langtangen/py1st/ in ()

Re: [Tutor] Regular expression oddity

2008-11-23 Thread spir
bob gailer a écrit : Emmanuel Ruellan wrote: Hi tutors! While trying to write a regular expression that would split a string the way I want, I noticed a behaviour I didn't expect. re.findall('.?', 'some text') ['s', 'o', 'm', 'e', ' ', 't', 'e', 'x', 't', ''] Where does the last

Re: [Tutor] faulty code (maths)

2008-11-23 Thread Kent Johnson
On Sun, Nov 23, 2008 at 6:37 AM, David <[EMAIL PROTECTED]> wrote: > I am trying to solve exercise 1.18 ("Why does the following program not work > correctly?"), but I don't find the mistake: why does the line > > q = sqrt(b*b - 4*a*c) > > cause an error? I was playing around with the code, but got

[Tutor] faulty code (maths)

2008-11-23 Thread David
Hello everybody, I recently came across a book by Prof. Langtangen: Indroduction to Computer Programming: http://folk.uio.no/hpl/INF1100/INF1100-ebook-Aug08.pdf I am trying to solve exercise 1.18 ("Why does the following program not work correctly?"), but I don't find the mistake: why does th

[Tutor] (no subject)

2008-11-23 Thread Jia Lu
___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Size of Python Console

2008-11-23 Thread Alan Gauld
"Wayne Watson" <[EMAIL PROTECTED]> wrote find away to set the size. One just brings up the program and sets the width-height using the properties option in the upper-left corner. Next one saves them when exiting. That only works on your PC, any other user needs to do the same thing. Crea

Re: [Tutor] Size of Python Console

2008-11-23 Thread Wayne Watson
Title: Signature.html Well, while I'm waiting for the moderator approval* on a message I sent 3 hours ago concerning my inability to create a shortcut with properties, I'll mention I later did find away to set the size. One just brings up the program and sets the width-height using the properti