Re: [Tutor] Cookielib - CookieJar objects

2005-06-28 Thread Danny Yoo
On Wed, 29 Jun 2005, Peter Szinek wrote: > Hello Denise, > > How about this: > > myjar = cookielib.CookieJar() > for cookie in myjar: > print cookie.value > > In this case the above code should print a single 'B'. Yes, whenever the documentation talks about something being "iterable", the

Re: [Tutor] Cookielib - CookieJar objects

2005-06-28 Thread Peter Szinek
Hello Denise, How about this: myjar = cookielib.CookieJar() for cookie in myjar: print cookie.value In this case the above code should print a single 'B'. HTH, Peter Liam Clarke wrote: > Hi Denise, > > Have you tried 'print myjar.value'? > > Regards, > > Liam Clarke > On 6/29/05, *D. H

Re: [Tutor] Cookielib - CookieJar objects

2005-06-28 Thread Liam Clarke
Hi Denise, Have you tried 'print myjar.value'? Regards, Liam ClarkeOn 6/29/05, D. Hartley <[EMAIL PROTECTED]> wrote: Hi everyone! Just a quick question about cookie jars:when I create a myjar = cookielib.CookieJar(), and go to a website toget the particular cookie, I get something like this in

[Tutor] Cookielib - CookieJar objects

2005-06-28 Thread D. Hartley
Hi everyone! Just a quick question about cookie jars: when I create a myjar = cookielib.CookieJar(), and go to a website to get the particular cookie, I get something like this in return: or, if I do print myjar, this: ]> . Now, if I wanted to pull out just the value from the cookie (i.e., "B

Re: [Tutor] Interesting problem

2005-06-28 Thread Chuck Allison
I may be missing something, but isn't this what __dict__ does? Just return self.__dict__. This is an old message, so this may have mentioned already. Sorry if that's the case. I'm a little behind. Kent Johnson wrote: >Smith, Jeff wrote: > > >>Here would be the usage: >> >>myinst = MyClass() >

Re: [Tutor] slicing nested lists/dicts/tuples

2005-06-28 Thread Reed L. O'Brien
Reed L. O'Brien wrote: >Luis N wrote: > > > >>Hi, >> >> >> >l > > >>[{'last': 'Bar', 'first': 'Foo'}, {'last': 'Bar', 'first': 'Foo'}, >>{'last': 'Bar', 'first': 'Foo'}, {'last': 'Bar', 'first': 'Foo'}] >> >> >>This is how I imagine it: >> >>for i in l: >>for j in l

Re: [Tutor] slicing nested lists/dicts/tuples

2005-06-28 Thread Reed L. O'Brien
Luis N wrote: > Hi, > > >>> l > [{'last': 'Bar', 'first': 'Foo'}, {'last': 'Bar', 'first': 'Foo'}, > {'last': 'Bar', 'first': 'Foo'}, {'last': 'Bar', 'first': 'Foo'}] > > > This is how I imagine it: > > for i in l: > for j in l[i]: > for k in l[i][j]: > print k.get('first')

[Tutor] Minesweeper OOT

2005-06-28 Thread Alberto Troiano
Hey tutors Just want to inform that I'm Out Of Town(OOT) and I haven't had the chance to a PC until this very moment. Sorry I didn't reply to your help, I have just read them and I think I get the idea Thanks to all who helped me and I'll be home next Tuesday (a week from now) and I'll give y

Re: [Tutor] slicing nested lists/dicts/tuples

2005-06-28 Thread Brian van den Broek
Luis N said unto the world upon 28/06/2005 15:25: > Hi, > > l > > [{'last': 'Bar', 'first': 'Foo'}, {'last': 'Bar', 'first': 'Foo'}, {'last': > 'Bar', 'first': 'Foo'}, {'last': 'Bar', 'first': 'Foo'}] > > > This is how I imagine it: > > for i in l: > for j in l[i]: > for k in l[i][j]: >

[Tutor] slicing nested lists/dicts/tuples

2005-06-28 Thread Luis N
Hi, >>> l [{'last': 'Bar', 'first': 'Foo'}, {'last': 'Bar', 'first': 'Foo'}, {'last': 'Bar', 'first': 'Foo'}, {'last': 'Bar', 'first': 'Foo'}] This is how I imagine it: for i in l:     for j in l[i]:         for k in l[i][j]:             print k.get('first')     print k.get('last') Is

[Tutor] html scrapeing

2005-06-28 Thread Nathan Hughes
Hi, Ive been looking for way to scrape the data from a html table, but dont know even where to start, or how to do.. an example can be found here of the table ( http://www.dragon256.plus.com/timer.html ) - i'd like to extract all the data except for the delete column and then just print each row.

Re: [Tutor] Alternative File I/O for Tuples (fwd)

2005-06-28 Thread Don Parris
On Tue, 28 Jun 2005 05:50:54 -0400 Kent Johnson <[EMAIL PROTECTED]> wrote: > Don Parris wrote: > > Just getting back to this - Mondays are always hectic. This recipe is > > the one I saw and like. It looks cool! In my brief efforts tinkering > > with it, I am not really getting very far. I sav

Re: [Tutor] OO refactoring trial ??

2005-06-28 Thread Chinook
On Tue, 28 Jun 2005 07:31:43 -0400, Chinook wrote (in article <[EMAIL PROTECTED]>): > [[ This message was both posted and mailed: see >the 'To' and 'Newsgroups' headers for details. ]] > Sorry for the duplication. I'm trying Hogwasher on OS X and it seems I better look around some more.

Re: [Tutor] OO refactoring trial ??

2005-06-28 Thread Chinook
Clarifications: 1) Truth test simplified after a %) by Peter Otten - thanks. In reality the "testit" methods will all be quite different as you might imagine (as will the "doit" methods). 2) A final subclass will always return True, so there will always be a valid result.

Re: [Tutor] OO refactoring trial ??

2005-06-28 Thread Chinook
[[ This message was both posted and mailed: see the 'To' and 'Newsgroups' headers for details. ]] Clarifications: 1) Truth test simplified after a %) by Peter Otten - thanks. In reality the "testit" methods will all be quite different as you might imagine (as will the "doit" methods). 2) A

Re: [Tutor] Alternative File I/O for Tuples (fwd)

2005-06-28 Thread Kent Johnson
Don Parris wrote: > Just getting back to this - Mondays are always hectic. This recipe is the > one I saw and like. It looks cool! In my brief efforts tinkering with it, > I am not really getting very far. I saved the recipe, and import it into > the file containing all my database functions.

Re: [Tutor] super() and inherited attributes?

2005-06-28 Thread jfouhy
Quoting Alan G <[EMAIL PROTECTED]>: > I don't know the direct answer but the more common way > of doing that in Python is not to use super() but just > call the inherited constructor directly: > > Parent.__init__(self,'I am a child') > > > SO if you just want to fix the itch use that, if you

Re: [Tutor] super() and inherited attributes?

2005-06-28 Thread Alan G
|class Parent(object): | def __init__(self, name="I am a parent"): | self.name = name | |class Child(Parent): | def __init__(self, number): | super(Parent, self).__init__("I am a child") | self.number = number | |# I would like it to produce the following: |>> c = Child(23) |>> c