473,320 Members | 1,572 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

asyncore module for loading websites

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
2 1551

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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: David M. Wilson | last post by:
Hi peeps, I finally got around recently to doing something serious using Python for serving network clients asynchronously, deciding on asyncore as my starting point. After 2 days or so of...
0
by: Markus Franz | last post by:
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...
3
by: Anand Pillai | last post by:
This is for folks who are familiar with asynchronous event handling in Python using the asyncore module. If you have ever used the asyncore module, you will realize that it's event loop does not...
1
by: export | last post by:
Is there any tutorial and docs with samples how to use asyncore module? Thanks Lad
1
by: Jos | last post by:
Hello all. I have a working server, using the asyncore/chat module, which enables logging in, rooms and private messaging. I've used this framework to make some simple games that only required...
3
by: Jos | last post by:
Hello. I'm using the asyncore and _chat modules to create a network server. I also have, running in a separate thread(s), a "producer" which needs to "push" data onto the network connection(s)....
5
by: JamesHoward | last post by:
I have a problem with python's asyncore module throwing a bad file descriptor error. The code might be difficult to copy here, but the problem is essentially: The server wants to sever the...
2
by: Indy | last post by:
Greetings. I am writing an asynchronous server, and I use the standard library's module asyncore. I subclass asyncore.dispatcher. handle_accept works just right, that is, when a client socket...
8
by: Frank Millman | last post by:
Hi all I have been using my own home-brewed client/server technique for a while, using socket and select. It seems to work ok. The server can handle multiple clients. It does this by creating a...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.