additional info

Andrew Markebo flognat at flognat.myip.org
Tue Feb 20 14:42:40 EST 2001


Lets see.. You want to do this (see if you can fetch a page) doing as
few imports as possible.. Or even no imports??

I think you have got the fact 'python methods' wrong.. 

Well first of all, to be able to get data over the internet, you have
to import the socket module, it can be compiled into the python
interpreter, or can be as pyd(?) file.. (ehm to be honest, some of the
new Solaris versions have some kind of /dev/ device that you can open
and write some data to in a normal way, and read the answer from the
other end of the internet)

Ok so we go for sockets?? Then it is easy for you to hack a small
non-generic functionality to get certain webpages, you kan hardcode
strings and so on..

Write to the socket ('''HEAD [WEBPAGE] HTTP/1.1\n\r[some headers]''')
read from the socket, and see if you return a 404 or 200.. 

        /Andy


/ Lee Reilly CS1997 <lreilly at cs.strath.ac.uk> wrote:
| i'm trying to do this using python methods, which only support commonly
| used modules e.g. string, math, etc. i had a look at the httplib module,
| which seems like the ideal solution but this isn't supported in python
| methods.
| 
| is the use of this module the only solution to the problem?
| 
| nb: i can use the module in an *external* python method but this is a
| last resort.
| 
| thanks for the bandwidth,
| 
| lee



More information about the Python-list mailing list