By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
457,948 Members | 1,492 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 457,948 IT Pros & Developers. It's quick & easy.

asyncore module for loading websites

P: n/a
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
Jul 18 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a

Maybe this is what you are looking for

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

/Jean Brouwers
ProphICy Semiconductor, Inc.
In article <cb*************@news.t-online.com>, Markus Franz
<ma**@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

Jul 18 '05 #2

P: n/a
On Wed, Jun 23, 2004 at 03:45:23PM +0200, Markus Franz 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


A similar question was asked a few months ago... here's my answer:
http://groups.google.com/groups?hl=e...t%40python.org

My solution there uses Twisted, rather than asyncore, but other than that it
does what you want.

-Andrew.
Jul 18 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.