Re: [Tutor] Key Error

2007-07-09 Thread Alan Gauld
"jim stockford" <[EMAIL PROTECTED]> wrote >> (The tests at the end are poorly written too. > > If you'd be willing to share your strong words, I'd > be grateful to learn better alternatives. OK, The strong words referred to the entire piece and the biggest error was the lack of try/except or g

Re: [Tutor] Key Error

2007-07-08 Thread Sara Johnson
If this is in reference to the code that I listed. I have no experience with Python so I may have left something off unknowingly which resulted in him questioning whatever was there. The strong words probably should be directed at me for not knowing what I'm doing. jim stockford <[EMAIL

Re: [Tutor] Key Error

2007-07-08 Thread jim stockford
On Jul 8, 2007, at 9:45 AM, Alan Gauld wrote: > (The tests at the end > are poorly written too. If one of my team produced code like > this I'd be having strong words with them!) If you'd be willing to share your strong words, I'd be grateful to learn better alternatives. __

Re: [Tutor] Key Error

2007-07-08 Thread Alan Gauld
"Sara Johnson" <[EMAIL PROTECTED]> wrote > I apologize...but what is, 'grep'? The General Regular Expression Parser - at least that's one of the explanations. (Another is that it is the ed search command, and there are at least two more, it's part of the Unix mythology, debated for at leas

Re: [Tutor] Key Error

2007-07-08 Thread Bob Gailer
Sara Johnson wrote: > On how the 'h' was created > > Well, it appears 'h' is referenced in a few spots in this code. It > looks like initially, at least, a dictionary 'h' is created and some h > keys and sub keys follow, obviously from the purpose of this project > (having to do with pick

Re: [Tutor] Key Error

2007-07-08 Thread Bob Gailer
Sara Johnson wrote: > Should I temporarily comment out the other values (i.e., WSSD, > WSPD...)? I'm getting an error now that says: > > File "./mymods.py", line 122 > if wssd<-989. or wspd<-989. or wmax<-989.: break > ^ > SyntaxError: invalid syntax Please post (always) the surroundi

Re: [Tutor] Key Error

2007-07-08 Thread Sara Johnson
I appologize...but what is, 'grep'? I'm at the end of my rope, which right now looks about as sturdy as string (and I don't mean a string buffer either)!!! Okay, where to go from here... Again, as I mentioned there may be holes in what I'm giving but that's because 1). segments of this

Re: [Tutor] Key Error

2007-07-08 Thread Bob Gailer
Sara Johnson wrote: > Okay, it is VERY long! So long in fact that I can't get to the top of > it to copy from where it begins. Basically it's a series of codes > like 'WSSD' followed by values like 0.2 (more than just > the ones I listed, perhaps a few hundred. The end gives the s

Re: [Tutor] Key Error

2007-07-08 Thread Alan Gauld
"Sara Johnson" <[EMAIL PROTECTED]> wrote > Probably best if I skip the example and show what code I do have: > ~~~ > for key in h.keys(): >wssd=h[key]['WSSD'] >wspd=h[key]['WSPD'] >wmax=h[key]['WMAX'] >newi=h[key]['NEWI'] >if wssd<-989. or wspd<-98

Re: [Tutor] Key Error

2007-07-08 Thread Bob Gailer
Sara Johnson wrote: > > Probably best if I skip the example and show what code I do have: > ~~~ > for key in h.keys(): > wssd=h[key]['WSSD'] > wspd=h[key]['WSPD'] > wmax=h[key]['WMAX'] > newi=h[key]['NEWI'] > if wssd<-989. or wspd<-989. or wmax<-989

Re: [Tutor] Key Error

2007-07-08 Thread Sara Johnson
only error at the moment seems to be this line: newi=h[key]['NEWI'] But as you can see, the other items are set up the same way. Thanks bundles!!! Sara Message: 7 Date: Sun, 08 Jul 2007 02:21:25 -0400 From: Brian van den Broek Subject: Re: [Tutor] Key Error To: [EM

Re: [Tutor] Key Error

2007-07-07 Thread Brian van den Broek
Sara Johnson said unto the world upon 07/08/2007 01:34 AM: > Sorry, this is probably too general a question, but I can't find > any specific information on it. What exactly is a "key error" and > how do I clear it? > > I entered something like this: > > abcd=h[key]['ABCD'] > > and when I run it

[Tutor] Key Error

2007-07-07 Thread Sara Johnson
Sorry, this is probably too general a question, but I can't find any specific information on it. What exactly is a "key error" and how do I clear it? I entered something like this: abcd=h[key]['ABCD'] and when I run it I'm getting KeyError: 'ABCD' What does this mea