[Tutor] urllib.urlopen & open differences
ak@silmarill.org
ak@silmarill.org
Mon, 16 Jul 2001 19:44:08 -0400
On Mon, Jul 16, 2001 at 04:19:02PM -0700, Mike Barrett wrote:
> Hi, I was just playing with urllib and decided to mess around with
> a simple website monitoring tool. The idea is that the script would go
> out, read a page, and if the page was different than a file stored (an
> assumed 'good' copy), then it would send an alert. I ran into a problem
> however, when I noticed that filedescriptors returned by open() act
> differently when they 'read' than filedescriptors returned by
> urllib.urlopen().
> It seems that the open() fd's return raw data (\'s
> escaped) whereas urllib.urlopen() returns the data normally (no
> escaping). Does anyone know if there is a way to change this? I'd like
> to just compare the two strings, but as of now it looks like I'm going to
> have to do some line editing.
> Any suggestions on how to deal with this?
you can hash() what the urlopen returns and save that.. Just a guess.
>
> ________________________________________________________________________
> Mike Barrett | Beer is proof that God loves us
> mike@daboyz.org | and wants us to be happy.
> www.daboyz.org | -- Benjamin Franklin
> ------------------------+-----------------------------------------------
>
>
> _______________________________________________
> Tutor maillist - Tutor@python.org
> http://mail.python.org/mailman/listinfo/tutor
--
Cymbaline: intelligent learning mp3 player - python, linux, console.
get it at: http://silmarill.org/cymbaline