[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.python

URL in CGI problems

rodmc

2/11/2008 1:17:00 PM

Hi,

I am writing a small CGI app which tests if another webpage exists,
the pages are on a Wiki system. Anyway when I run the same function
(see below) from within IDLE it is ok, however when it is run from
within the CGI script I get a socket error::

"URLError:
reason = <socket.error instance>"

I am not quite sure what is causing this, is there a special way of
dealing with such things from within CHI script? I have pasted the
offending function below, along with only the import statement which
relates to that function.

Thanks in advance for any help.

Kind regards,

rod

From CGI version:

from urllib2 import urlopen as urlopen

def urlexists(url):
path="http://x.y.z/wiki/index.php?title=...
sock = urlopen(path)
page=sock.read()
if "There is currently no text in this page" in page:
print "found"
return True
else:
return False


Ammended IDLE version:

from urllib2 import urlopen as urlopen
import os,sys

def urlexists(url):
path="http://www.peachbase.org/peachbase/index.php?title=...
sock = urlopen(path)
page=sock.read()
if "There is currently no text in this page" in page:
print "found"
return True
else:
print "not found"
return False


if __name__=="__main__":
urlexists("cheese_test")
13 Answers

THULL=

5/14/2009 11:51:00 AM

0

I'm guessing Lost is based on Judeo/Christian mythos. Jacob and the
other island guy are good and evil. John 'dies' but comes back to
life. Ben refers to John as 'Moses.' Are the survivors the disciples/
apostles being tested? And some believe the New testament was based
based on Egyptian tradition, which would help to explain the
hieroglyphics and 'Egyptian' imagery. Claire is Mother Mary, Aaron
Christ and Charlie is Joseph, the surrogate father. Is Jack the
prodigal son....?

Mike Voss

5/14/2009 12:16:00 PM

0

"Michael Schey" <mscheynj@nospamYahoo.com> wrote in message
news:o60o055te9ht3n97951b0877luolm7g2fh@4ax.com...
> On Thu, 14 May 2009 00:43:47 -0700 (PDT), Carol in LA
> <chicks5026@aol.com> wrote:
>
>>All I have to say is:
>>
>>What in the HOLY FUCK is going on?????? Loophole??????
>>Juliet??????? AGGHHHHH!!!!!!
>
>
> yeah, i didn't get that loophole thing
> and what was with the _______ in the box. Huh?

In the beginning we saw Jacob and another man on a beach of the island,
idly declaring hatred of one another, and Jacob's nemesis complaining
because he could not kill Jacob, but promising to find a way.
For some reason these two cannot kill one another - it can only
be done by another. (There's something VERY familiar about
that idea, but I can't put my finger on it, although I keep
thinking it might relate to Gaiman's American Gods, a book
I started but didn't finish). So the loophole was to take on the guise
of dead people in an elaborate scheme to get someone else who
hated Jacob enough to kill him close enough to do the job.
He probably was "Christian Sheperd" first, guiding Real Locke
through the events that led to his death. Once Ben and Locke's
body were back on the island, he took Locke's identity and
got Ben to come with him to Jacob (he probably was also Ben's
daughter when she told him to do Locke's bidding). There are
probably other possessions of the dead that are less obvious
at the moment. So the loophole was finding a way to kill
Jacob by proxy (which Jacob seemed quite resigned to;
and Jacob seemed to have his own plans in visiting most
of the original Losties - perhaps influencing Hurley by
using his dead friend's bodies to try and get hiim back to
the island).


Mike

>
> And was _______ the one in the beginning with jacob that said he was
> going to kill him and then at the end did _________
> http://michaelschey.blo...

Bruce In Belle Harbor

5/14/2009 1:46:00 PM

0

The series has been so good that I started worrying that there will be
no way to satisfy us with a good ending next year! It will probably
end with alot of questions not answered, which in and of itself is not
bad. However, too many unanswered questions or contrived loose end tie
ups may be something to worry about. So... join me in not watching
the last season and have LOST end in the white flash of last night!
Bruce in Belle Harbor

Mike Voss

5/14/2009 2:24:00 PM

0

On May 14, 6:46 am, nyy7 <bbernf...@gmail.com> wrote:
> The series has been so good that I started worrying that there will be
> no way to satisfy us with a good ending next year!  It will probably
> end with alot of questions not answered, which in and of itself is not
> bad. However, too many unanswered questions or contrived loose end tie
> ups may be something to worry about.  So... join me in not watching
> the last season and have LOST end in the white flash of last night!
> Bruce in Belle Harbor

LOL!

This I cannot do!
It's rare enough a show I like gets to *have*
a conclusion! I'll be needing to see this one.

Mike

Andrew

5/14/2009 7:56:00 PM

0


I think Ben's daughter was the Old Smoke Monster, judging Ben in the same
way the Mr. Eko had been judged (in that case, by his brother I believe).

Thanks for shedding some light on parts of the story. Can't wait for next
season.

-Andrew

"Mike Voss" <mfvoss@earthlink.net> wrote in message
news:EbGdnU-WL9MRlpHXnZ2dnUVZ_gOdnZ2d@earthlink.com...
> "Michael Schey" <mscheynj@nospamYahoo.com> wrote in message
> news:o60o055te9ht3n97951b0877luolm7g2fh@4ax.com...
>> On Thu, 14 May 2009 00:43:47 -0700 (PDT), Carol in LA
>> <chicks5026@aol.com> wrote:
>>
>>>All I have to say is:
>>>
>>>What in the HOLY FUCK is going on?????? Loophole??????
>>>Juliet??????? AGGHHHHH!!!!!!
>>
>>
>> yeah, i didn't get that loophole thing
>> and what was with the _______ in the box. Huh?
>
> In the beginning we saw Jacob and another man on a beach of the island,
> idly declaring hatred of one another, and Jacob's nemesis complaining
> because he could not kill Jacob, but promising to find a way.
> For some reason these two cannot kill one another - it can only
> be done by another. (There's something VERY familiar about
> that idea, but I can't put my finger on it, although I keep
> thinking it might relate to Gaiman's American Gods, a book
> I started but didn't finish). So the loophole was to take on the guise
> of dead people in an elaborate scheme to get someone else who
> hated Jacob enough to kill him close enough to do the job.
> He probably was "Christian Sheperd" first, guiding Real Locke
> through the events that led to his death. Once Ben and Locke's
> body were back on the island, he took Locke's identity and
> got Ben to come with him to Jacob (he probably was also Ben's
> daughter when she told him to do Locke's bidding). There are
> probably other possessions of the dead that are less obvious
> at the moment. So the loophole was finding a way to kill
> Jacob by proxy (which Jacob seemed quite resigned to;
> and Jacob seemed to have his own plans in visiting most
> of the original Losties - perhaps influencing Hurley by
> using his dead friend's bodies to try and get hiim back to
> the island).
>
>
> Mike
>
>>
>> And was _______ the one in the beginning with jacob that said he was
>> going to kill him and then at the end did _________
>> http://michaelschey.blo...
>


Mike Voss

5/14/2009 8:18:00 PM

0

On May 14, 12:56 pm, "Andrew" <quinn.and...@gmail.comNOSPAMPLEASE>
wrote:

> I think Ben's daughter was the Old Smoke Monster, judging Ben in the same
> way the Mr. Eko had been judged (in that case, by his brother I believe).

Could be that you are correct.
I had thought we were just led to believe so (just as
we were led to believe that Locke had really been resurrected),
but Locke did express surprise when Ben told him what had
happened, so it may have just been a coincidence - unless
Smoky chose to do something in support of pseudo-Locke's
plan to kill Jacob. More questions to ponder :-)

Mike

Maureen

5/14/2009 9:34:00 PM

0

On May 14, 4:18 pm, mfv...@earthlink.net wrote:
> On May 14, 12:56 pm, "Andrew" <quinn.and...@gmail.comNOSPAMPLEASE>
> wrote:
>
> > I think Ben's daughter was the Old Smoke Monster, judging Ben in the same
> > way the Mr. Eko had been judged (in that case, by his brother I believe).
>
> Could be that you are correct.
> I had thought we were just led to believe so (just as
> we were led to believe that Locke had really been resurrected),
> but Locke did express surprise when Ben told him what had
> happened, so it may have just been a coincidence - unless
> Smoky chose to do something in support of pseudo-Locke's
> plan to kill Jacob. More questions to ponder :-)
>
> Mike



********************

As my nephew mentioned to me--a theme last night was "What's done is
done." If you think about it, much of the dialogue gives away what
went on, after you look back on it. So dead is dead, after all.

Circe

5/14/2009 10:10:00 PM

0

THULL= wrote:
> I'm guessing Lost is based on Judeo/Christian mythos. Jacob and the
> other island guy are good and evil. John 'dies' but comes back to
> life. Ben refers to John as 'Moses.'

I think you may be right. The translation for Richard's answer to the
question "What stands in the shadow of the statue" is apparently "He who
will save us all."

Circe

Carol in LA

5/15/2009 7:11:00 AM

0

On May 14, 2:33 pm, foxy1vi...@aol.com wrote:
> As my nephew mentioned to me--a theme last night was "What's done is
> done."  If you think about it, much of the dialogue gives away what
> went on, after you look back on it.  So dead is dead, after all.

So, if Dead is Dead, what does that mean about all the people who have
died on the island so far? Wasn't that Jack's purpose - to reset time
in order to save their lives?

Mike Voss

5/15/2009 7:39:00 AM

0

"Carol in LA" <chicks5026@aol.com> wrote in message
news:1da0c7f4-1f68-4471-9244-c906761c1c22@k9g2000pra.googlegroups.com...
On May 14, 2:33 pm, foxy1vi...@aol.com wrote:
> As my nephew mentioned to me--a theme last night was "What's done is
> done." If you think about it, much of the dialogue gives away what
> went on, after you look back on it. So dead is dead, after all.

So, if Dead is Dead, what does that mean about all the people who have
died on the island so far? Wasn't that Jack's purpose - to reset time
in order to save their lives?
************************
There's a large contingent of fans who

A) Think Jack is wrong (in everything he does)

and/or

B) *Want* Jack to be wrong.

So if Jack *is* wrong, his actions don't create a reset for the Losties.

Things to consider in support of this:

Jacob has an agenda involving the Losties (his visits to each at
crux points in their lives, and possibly appearing to Hurley as
those who died on the island). He clearly wanted them to come
to the island, both the first time *and* the second time. A reset
would make both meaningless to whatever scheme he has.
(Apparently related to his having apparently summoned
others to the island repeatedly as part of his "battle" or game with
his unnamed nemesis (somebody nicked him as Darkob on the
Lost newsgroup - I'll stick with that <g>).

Jacob seems to have anticipated, perhaps cooperated, in his own apparent
death
aspart of Darkob-as-Locke's manipulation of Ben (the loophole Darkob
declared he would find in the opening scene). I'm thinking he will still
be around in one form or another next season (the Phoenix myth is
being mentioned in a few posts on the Lost group - Jacob rising from
the fire that appears to consume him in his final scene of this ep).
So I think whatever his scheme for the Losties involves,
he'll be there to see it played out, and so will they. Hard
to predict exactly how it would play out, though.

The bomb may NOT have exploded after all.
The whiteout with the black Lost logo that ends
the ep is a mirror image of the usual ep ending,
it may be nothing more than symbolic of a shift in
power between the light and dark forces that have
been hinted at throughout the series (Locke's
white and black sides speech to Walt about backgammon
would be symbolic of the game between Jacob and Darkob;
the "Adam and Eve" found dead in the cave had black and white
stones found with them; numerous other light/dark motifs have been
seen throughout the series, and Jacob and Darkob wore dark and light
clothing). IF the bomb never really went off, then "what happened,
happened": the Incident created a need to wall off the basement of
the Swan station, and the button had to be pushed to release the
energy beneath it properly, and Desmond failing to push it on
Sept 22, 2001 probably brought Flight 815 out of the sky.
That's what the "I think/hope that Jack is wrong" contingent
would like to see revealed next season: everything just as
Miles suggested, Jack's actions contributing to rather than
preventing the Incident, and everyone right where we left
them. And everyone dead is still dead - but fodder for "possession"
by Darkob and/or Jacob :-)

Mike