Piet van Oostrum wrote:
grocery_stocker (gs) wrote:
gs> The following code gets data from 5 different websites at the "same
gs> time".
[snip]
gs> start = time.time()
gs> def main():
gs> for i in range(5):
gs> t = MyUrl(queue)
gs> t.setDaemon(True)
gs> t.star
> grocery_stocker (gs) wrote:
[snip]
>gs> Maybe I'm being a bit daft, but what prevents the data from www.yahoo.com
>gs> from being mixed up with the data from www.google.com? Doesn't using
>gs> queue() prevent the data from being mixed up?
Nothing in your script prevents the data from gett
grocery_stocker a écrit :
On May 9, 8:36 am, Piet van Oostrum wrote:
grocery_stocker (gs) wrote:
gs> The following code gets data from 5 different websites at the "same
gs> time".
gs> #!/usr/bin/python
gs> import Queue
gs> import threading
gs> import urllib2
gs> import time
On May 9, 8:36 am, Piet van Oostrum wrote:
> > grocery_stocker (gs) wrote:
> >gs> The following code gets data from 5 different websites at the "same
> >gs> time".
> >gs> #!/usr/bin/python
> >gs> import Queue
> >gs> import threading
> >gs> import urllib2
> >gs> import time
> >gs> hosts = ["ht
> grocery_stocker (gs) wrote:
>gs> The following code gets data from 5 different websites at the "same
>gs> time".
>gs> #!/usr/bin/python
>gs> import Queue
>gs> import threading
>gs> import urllib2
>gs> import time
>gs> hosts = ["http://yahoo.com";, "http://google.com";, "http://amazon.com
The following code gets data from 5 different websites at the "same
time".
#!/usr/bin/python
import Queue
import threading
import urllib2
import time
hosts = ["http://yahoo.com";, "http://google.com";, "http://amazon.com";,
"http://ibm.com";, "http://apple.com";]
queue = Queue.Queue()