Re: [Tutor] Inherit from int?

2007-05-13 Thread Alan Gauld
"John Fouhy" <[EMAIL PROTECTED]> wrote > Subclassing int and other types is a bit special. Check out this > page; it may help you: > http://www.python.org/download/releases/2.2.3/descrintro/#__new__ > In case others have the same problem... John's link didn't work for me but I eventually found t

Re: [Tutor] Inherit from int?

2007-05-13 Thread wesley chun
> I'm stumped. This silly bit of code doesn't work. I expect the > output to be 8, not 18. What am I missing? > > class Under10(int): > def __init__(self, number): > number %= 10 > int.__init__(self, number) marilyn, i agree with most of the earlier replies... you need to u

Re: [Tutor] Inherit from int?

2007-05-13 Thread Marilyn Davis
Thank you everyone. I, indeed, found it in your book, Wes, after I knew it was something extra special. The explanations here are great! Thank you everyone. Marilyn On Sun, 13 May 2007, wesley chun wrote: > > I'm stumped. This silly bit of code doesn't work. I expect the > > output to be

[Tutor] Getting value from web page

2007-05-13 Thread Vladimir Strycek
Hi all, i have a page which when i download from web by python and put tu variable have something like: 119/1157/43/40 neer end ( actualy this is only thing on that page + ) What i need actualy is to get this values 119/1157/43/40 to variables, they a

[Tutor] Parsing text file

2007-05-13 Thread Alan
I'm looking for a more elegant way to parse sections of text files that are bordered by BEGIN/END delimiting phrases, like this: some text some more text BEGIN_INTERESTING_BIT someline1 someline2 someline3 END_INTERESTING_BIT more text more text What I have been doing is clumsy, involving conver

Re: [Tutor] Parsing text file

2007-05-13 Thread John Fouhy
On 14/05/07, Alan <[EMAIL PROTECTED]> wrote: > I'm looking for a more elegant way to parse sections of text files that > are bordered by BEGIN/END delimiting phrases, like this: > > some text > some more text > BEGIN_INTERESTING_BIT > someline1 > someline2 > someline3 > END_INTERESTING_BIT > more t

Re: [Tutor] Parsing text file

2007-05-13 Thread Alan Gauld
"Alan" <[EMAIL PROTECTED]> wrote > I'm looking for a more elegant way to parse sections of text files > that > are bordered by BEGIN/END delimiting phrases, like this: > > some text > BEGIN_INTERESTING_BIT > someline1 > someline3 > END_INTERESTING_BIT > more text > > What I have been doing is cl

[Tutor] web spider

2007-05-13 Thread max .
hello i am a beginner programmer and i am planning a project that will take a keyword enter that in google and start searching through links ans saving web pages if anyone can help or might know of any tutorials about: writing to websites searching links creating files and web spiders in general