[Tutor] Authen::ACE

2006-03-24 Thread Asif Iqbal
Hi All Does anyone know if there is any python module similar to Authen::ACE available that I can use to authenticate against a RSA SecurID server? Also, what would be a good irc chnl where python folks hang around? Thanks -- Asif Iqbal PGP Key: 0xE62693C5 KeyServer: pgp.mit.edu "..there are t

Re: [Tutor] efficient method to search between two lists

2006-03-24 Thread Smith
Srinivas Iyyer wrote: | for i in list_b: | ... co = i.split('\t')[2] | ... items = da.get(co) ^ -| | Are you sure that all co's are in da? One other thing that occurs to me from looking at your dictionary approach is

Re: [Tutor] What is wrong my code?

2006-03-24 Thread Danny Yoo
> I did like your comments about input and raw_input. > What about if I use on my program: > > leg1 = int( raw_input('Enter the first leg of the > triangle: ') ) > leg2= int( raw_input('Enter the second leg of the > triangle: ') ) > > What do you think? This is better/safer, right? Hi Hoffmann, Y

Re: [Tutor] What is wrong my code?

2006-03-24 Thread Hoffmann
--- Danny Yoo <[EMAIL PROTECTED]> wrote: > > #!/usr/bin/python > > > > import math > > > > print '''This program calculates the lenght of the > > hypotenuse of a right triangle > > given the lenghts of the two legs as > > parameters.\n''' > > > > leg1 = input('Enter the first leg of the triang

Re: [Tutor] What is wrong my code?

2006-03-24 Thread Danny Yoo
> #!/usr/bin/python > > import math > > print '''This program calculates the lenght of the > hypotenuse of a right triangle > given the lenghts of the two legs as > parameters.\n''' > > leg1 = input('Enter the first leg of the triangle: ') > leg2 = input('Enter the second leg of the triangle: '

Re: [Tutor] What is wrong my code?

2006-03-24 Thread Alan Gauld
> Could anyone, please, let me know what is wrong with > my code (shown below)? I am getting a runtime error. For future reference can you post the error as well as the code. It helps a lot in figuring out the problem. Alan G. ___ Tutor maillist - T

Re: [Tutor] What is wrong my code?

2006-03-24 Thread Hoffmann
--- Danny Yoo <[EMAIL PROTECTED]> wrote: > > > leg1 = raw_input('Enter the first leg of the > triangle: > > ') > > leg2 = raw_input('Enter the second leg of the > > triangle: ') > > Hi Hoffmann, > > leg1 and leg2 here are strings, because raw_input() > is guaranteed to > return strings. > > >

Re: [Tutor] What is wrong my code?

2006-03-24 Thread Matthew White
Hi Hoffman, Include the definition for hypotenuse() before it is called in your script. Also, please include the full output from the error next time. It helps with figuring out the exact problem. :) -mtw On Fri, Mar 24, 2006 at 01:02:45PM -0800, Hoffmann ([EMAIL PROTECTED]) wrote: > Hello: >

Re: [Tutor] What is wrong my code?

2006-03-24 Thread Danny Yoo
> leg1 = raw_input('Enter the first leg of the triangle: > ') > leg2 = raw_input('Enter the second leg of the > triangle: ') Hi Hoffmann, leg1 and leg2 here are strings, because raw_input() is guaranteed to return strings. You'll want to do something to turn those strings into numbers, since t

Re: [Tutor] function signatures for callbacks

2006-03-24 Thread Danny Yoo
> Ok I tried this and it is good. > > I don't think that I need the _internal_shout anymore as this code > already wraps the exception handling and I can decide what I want to > display in the above except statement. > > Unless I am missing something? Yup, nope. *grin* That was just there to sho

[Tutor] What is wrong my code?

2006-03-24 Thread Hoffmann
Hello: Could anyone, please, let me know what is wrong with my code (shown below)? I am getting a runtime error. Thanks! Hoffmann ps: The code: #!/usr/bin/python import math print '''This program calculates the lenght of the hypotenuse of a right triangle given the lenghts of the two legs a

Re: [Tutor] function signatures for callbacks

2006-03-24 Thread Don Taylor
Danny Yoo wrote: > > ### > ## Pseudocode for sending 'x' to every listener (untested) > class CallbackError(Exception): > pass > > for l in self.listeners: > try: > l(x) > except Exception, e: > raise CallbackErr

Re: [Tutor] function signatures for callbacks

2006-03-24 Thread Danny Yoo
On Fri, 24 Mar 2006, Don Taylor wrote: > When I first read your response I did not see how it helped me, but now > I realise that it allows me to add some context to the exception message. > > I don't suppose that I can change the traceback to point at the > definition of f2 instead of shout() b

Re: [Tutor] TypeError: dict objects are unhashable

2006-03-24 Thread Alan Gauld
Ben, Others have addressed the cause of the error, but... > accounts = {} > UserCursor.execute(sqlstr) > rows = UserCursor.fetchall() > UserConn.commit() > for row in rows: >U = row['User'] >P = row['Password'] >InnerDict = {} >

Re: [Tutor] urlopen: where are the results?

2006-03-24 Thread Alan Gauld
> >And if you went to the index and click 'f' you will find a link > How do I get to the index?? There should be a link at the top of each document page HTH, Alan G. ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] i need help please read (fwd)

2006-03-24 Thread Alan Gauld
> Try to ignore the misspellings for the moment. I'm think he's really > trying to say: > >How do you get Python to make a dialog box pop up? You know, like >asking a question or something. How do you connect the buttons up so >it does something when you press it? Aha! Now I see it

Re: [Tutor] function signatures for callbacks

2006-03-24 Thread Don Taylor
Danny: Thanks for this, I think that I can use this idea. When I first read your response I did not see how it helped me, but now I realise that it allows me to add some context to the exception message. I don't suppose that I can change the traceback to point at the definition of f2 instead o

Re: [Tutor] i need help please read (fwd)

2006-03-24 Thread Danny Yoo
> > you no like ask you a question or somthin. > > Danny was simply asking for more information so that we can > answer the question in a useful way. Hi Alan, But you're misinterpreting that part of message. Let's look back at the message: """no it is not homework, i havent started y idea y

Re: [Tutor] TypeError: dict objects are unhashable

2006-03-24 Thread Hugo González Monteverde
Ben Vinger wrote: > But I get: > TypeError: dict objects are unhashable > Unfortunately, I just can't see what I'm doing wrong > InnerDict = {} InnerDict[U] = P accounts[InnerDict] = U Your logic is not right somewhere around this. I do not have a lot of c

Re: [Tutor] TypeError: dict objects are unhashable

2006-03-24 Thread Tim Golden
[Ben Vinger] | I want to create a dictionary (from SQL usernames) of | the format: | accounts = { | ('psmit', '123456'): 'psmit', | ('rmatt', 'mypass'): 'rmatt', | } Although possible, this structure looks a little topsy-turvy: you're keying the dictionary on the username

Re: [Tutor] TypeError: dict objects are unhashable

2006-03-24 Thread Kent Johnson
Ben Vinger wrote: > Hello > > I want to create a dictionary (from SQL usernames) of > the format: > accounts = { > ('psmit', '123456'): 'psmit', > ('rmatt', 'mypass'): 'rmatt', > } > > So I have: > accounts = {} > UserCursor.execute(sqlstr) > rows = UserC

Re: [Tutor] urlopen: where are the results?

2006-03-24 Thread Kermit Rose
    From: Alan Gauld Date: 03/23/06 11:34:33 To: Kermit Rose; Danny Yoo Cc: tutor@python.org Subject: Re: [Tutor] urlopen: where are the results?     Did you look at the url2lib documentation?       I thought I had,  but I did not see the examples.   I did not know enough to make sense

[Tutor] TypeError: dict objects are unhashable

2006-03-24 Thread Ben Vinger
Hello I want to create a dictionary (from SQL usernames) of the format: accounts = { ('psmit', '123456'): 'psmit', ('rmatt', 'mypass'): 'rmatt', } So I have: accounts = {} UserCursor.execute(sqlstr) rows = UserCursor.fetchall() UserConn.commit()

Re: [Tutor] Inner Class access to outer class attributes?

2006-03-24 Thread stv
> The problem appears to be that you need to read a bit more > about Pythons handling of variable names and objects. :-) Or learn to spend a bit more time digesting the helpful advice given here ... between this & the searching between two lists thread the quality of advice has been excellent. I

Re: [Tutor] i need help please read (fwd)

2006-03-24 Thread Alan Gauld
> no it is not homework, i havent started y idea yet but my question for now > basicly say how do you get python to make a box pop up? You can draw a box in many different ways, but its not clear what kind of box you want to pop-up, nor what you mean by pop-up. For example are you talking about a

Re: [Tutor] Simple way for i18n ?

2006-03-24 Thread Michael Lange
On Thu, 23 Mar 2006 23:58:58 +0100 "francois schnell" <[EMAIL PROTECTED]> wrote: > > Now I'd like to be able to change language without loging out, change > language, log in. > > Martelli says in his book that to set the default language for the app I > just need to do: > > >>> os.environ.setde