asyncore module for loading websites

Jean Brouwers mrjean1 at comcast.net
Wed Jun 23 18:44:32 CEST 2004


Maybe this is what you are looking for

<http://www.pythonapocrypha.com/Chapter15/Chapter15.shtml>

/Jean Brouwers
 ProphICy Semiconductor, Inc.


In article <cbc11a$p3p$07$1 at news.t-online.com>, Markus Franz
<mail at markus-franz.de> wrote:

> Hi.
> 
> Some URLs are passed to a python script as command line options like the
> following command
> 
> ./script.py http://www.websites1.com http://www.website2.com
> 
> (The number of passed URLs varies...)
> 
> Now my problem is:
> 
> How can I load and show the contents of these websites (from sys.argv) in
> parallel by using the asyncore module? At the moment I use the following
> script (it uses one child process for each URL):
> 
> 
> import sys, os
> for url in sys.argv[1:]:
>     pid = os.fork()
>     if pid == 0:
>         # placeholder for the loading routine
>         print website_contents
>         break
> 
> 
> Is the same possible with the asyncore module?
> Thank you.
> 
> 
> Markus Franz
> 
>



More information about the Python-list mailing list