Re: Testing for changes on a web page (was: how to find difference in number of characters)

2010-10-09 Thread D'Arcy J.M. Cain
On 09 Oct 2010 17:47:56 GMT Seebs wrote: > In other words, your problem here is that you haven't actually described > what you want. Slow down. Think! Describe what you want clearly enough > that any other person who reads your description can always come up with > the same answer you would for

Re: how to find difference in number of characters

2010-10-09 Thread Diez B. Roggisch
harryos writes: > On Oct 9, 4:52 pm, Peter Otten <__pete...@web.de> wrote: > >> >> You might get more/better answers if you tell us more about the context of >> the problem and add some details that may be relevant. >> >> Peter > > I am trying to determine if a wep page is updated by x number of

Testing for changes on a web page (was: how to find difference in number of characters)

2010-10-09 Thread geremy condra
On Sat, Oct 9, 2010 at 10:47 AM, Seebs wrote: > On 2010-10-09, harryos wrote: >> What I meant by number of characters was the number of edits happened >> between the two versions.. > > Consider two strings: > > Hello, world! > > Yo, there. > > What is the "number of edits happened between the two

Re: Testing for changes on a web page (was: how to find difference in number of characters)

2010-10-09 Thread Seebs
On 2010-10-09, harryos wrote: > What I meant by number of characters was the number of edits happened > between the two versions.. Consider two strings: Hello, world! Yo, there. What is the "number of edits happened between the two versions"? It could be: * Zero. I just typed them both from

Re: Testing for changes on a web page (was: how to find difference in number of characters)

2010-10-09 Thread Emmanuel Surleau
> On Oct 9, 5:41 pm, Stefan Behnel wrote: > > "Number of characters" sounds like a rather useless measure here. > > What I meant by number of characters was the number of edits happened > between the two versions..Levenshtein distance may be one way for > this..but I was wondering if difflib coul

Re: Testing for changes on a web page (was: how to find difference in number of characters)

2010-10-09 Thread harryos
On Oct 9, 5:41 pm, Stefan Behnel wrote: > "Number of characters" sounds like a rather useless measure here. What I meant by number of characters was the number of edits happened between the two versions..Levenshtein distance may be one way for this..but I was wondering if difflib could do this r

Testing for changes on a web page (was: how to find difference in number of characters)

2010-10-09 Thread Stefan Behnel
harryos, 09.10.2010 14:24: I am trying to determine if a wep page is updated by x number of characters..Mozilla firefox plugin 'update scanner' has a similar functionality ..A user can specify the x ..I think this would be done by reading from the same url at two different times and finding the c

Re: how to find difference in number of characters

2010-10-09 Thread harryos
On Oct 9, 4:52 pm, Peter Otten <__pete...@web.de> wrote: > > You might get more/better answers if you tell us more about the context of > the problem and add some details that may be relevant. > > Peter I am trying to determine if a wep page is updated by x number of characters..Mozilla firefox p

Re: how to find difference in number of characters

2010-10-09 Thread Peter Otten
harryos wrote: > but is there a way I can use difflib module to do this job? I'm afraid I can't help you with that. You might get more/better answers if you tell us more about the context of the problem and add some details that may be relevant. Peter -- http://mail.python.org/mailman/listi

Re: how to find difference in number of characters

2010-10-09 Thread harryos
On Oct 9, 2:45 pm, Peter Otten <__pete...@web.de> wrote: > > What would be an acceptable time? > Thanks for the reply Peter, I was using python functions I came across the net..not cpython implementations..Probably my low config machine is also to blame..(I am no expert at judging algorithm perfo

Re: how to find difference in number of characters

2010-10-09 Thread Peter Otten
harryos wrote: > I am trying to write a compare method which takes two strings and find > how many characters have changed. > > > def compare_strings(s1,s2): > pass > > > text1="goat milk" > text2="cow milk" > print compare_strings(text1,text2) > > This must give 3 ,since 3 characters are

how to find difference in number of characters

2010-10-09 Thread harryos
hi I am trying to write a compare method which takes two strings and find how many characters have changed. def compare_strings(s1,s2): pass text1="goat milk" text2="cow milk" print compare_strings(text1,text2) This must give 3 ,since 3 characters are changed between strings.I was advised