HP3000-L Archives

June 2000, Week 1

HP3000-L@RAVEN.UTC.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Robert Joseph <[log in to unmask]>
Reply To:
Date:
Thu, 1 Jun 2000 13:52:26 -0400
Content-Type:
text/plain
Parts/Attachments:
text/plain (26 lines)
Mark Bixby posted an example of the power of Perl when it comes to
network and sockets programming.  He also posted a challenge for anyone
to duplicate his example which used just just two lines of code.

Benji York also pointed out that Python can do this stuff easily and
posted a four line example using ftp.  He alluded to other modules, so I
used one of them to take up Mark's challenge.

The following TWO line script gets the Apache installation test page
from our HPe3000 system:

import urllib
(urllib.urlopen('http://sys3.npd.com/index.html')).readlines()

And the result (copied from the MS-DOS Prompt window):

D:\user\misc>d:\opt\python\python getfile.py
['<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">\012',
'<HTML>\012', '
<HEAD>\012', '  <TITLE>Test Page for Apache Installation on Web
Site</TITLE>\012
...<rest snipped for brevity>...

Rob Joseph
The NPD Group

ATOM RSS1 RSS2