Re: [Tutor] Selecting a browser

2007-12-01 Thread Martin Walsh
Ricardo Aráoz wrote: > Hi, I've checked webbrowser module and so far I find no way of selecting > a browser other than the default one. Say I want certain places opened > with IE and others with Mozilla, and I don't want to mess with the > user's setting of the default browser. Any tips? > TIA I t

Re: [Tutor] PyQt segfault

2007-12-01 Thread Tiago Saboga
On Sat, Dec 01, 2007 at 01:04:04AM +0100, David Boddie wrote: > Something like that, yes. The internal character data becomes invalid, but > there's still a reference to the QString object. > > Here's the original code posted by Tiago: > > > class Combobox(QtGui.QDialog): > > def __init__(sel

Re: [Tutor] Use of sqrt() from math module

2007-12-01 Thread Matt Smith
Michael H.Goldwasser wrote: > After using "import math" you will need to use the qualified name > math.sqrt(blah) to call the square root function. That explains the > NameError when trying to use the unqualified name, sqrt. > > As to your first message, the ValueError that you are reporting wit

Re: [Tutor] Use of sqrt() from math module (Out of office)

2007-12-01 Thread Pierre DeWet
I will be out of the office until Monday 10 December. If your request is urgent, please contact the helpdesk at: [EMAIL PROTECTED], alternatively, please dial: 0207 566 8771 Cheers Pierre ___ Tutor maillist - Tutor@python.org http://mail.python.org/mai

Re: [Tutor] Use of sqrt() from math module

2007-12-01 Thread زياد بن عبدالعزيز البات لي
Matt Smith wrote: > > Apologies, the actual error I get when I run the code above is: > > Traceback (most recent call last): >File "", line 31, in > NameError: name 'sqrt' is not defined > > The error I quoted first was when I tried to call 'math.sqrt(x)' > > Matt > Apologies myself... I

Re: [Tutor] Use of sqrt() from math module

2007-12-01 Thread Michael H. Goldwasser
Matt, After using "import math" you will need to use the qualified name math.sqrt(blah) to call the square root function. That explains the NameError when trying to use the unqualified name, sqrt. As to your first message, the ValueError that you are reporting with the usage math.sqrt is likel

Re: [Tutor] Use of sqrt() from math module

2007-12-01 Thread زياد بن عبدالعزيز البات لي
Matt Smith wrote: > Hi, Hi... > > I need to find the square root of a number in a program I am writing. I have > imported the 'math' module so I thought I could just call sqrt(x) but I get > an > error message. Extact from my code and error message below. > > > import sys, pygame, math You i

Re: [Tutor] Use of sqrt() from math module

2007-12-01 Thread Matt Smith
Matt Smith wrote: > import sys, pygame, math > > ... > > if ypos >= 384 and velocity > 0: > impactvel = sqrt(velocity ** 2 + (2 * gravity * (ypos - 384 * > 160))) > > ... > > > Traceback (most recent call last): > File "", line 32, in > ValueError: math domain error Apologies,

[Tutor] Use of sqrt() from math module

2007-12-01 Thread Matt Smith
Hi, I need to find the square root of a number in a program I am writing. I have imported the 'math' module so I thought I could just call sqrt(x) but I get an error message. Extact from my code and error message below. import sys, pygame, math ... if ypos >= 384 and velocity > 0: