Using Thread queues

Source: Internet
Author: User

W

Threading Programming using Python
Https://www.ibm.com/developerworks/cn/aix/library/au-threadingpython/index.html

C:\>python E:\MATHpyCLI\url_fetch_serial.py<! DOCTYPE html>'Utf-8'> <title>Redis</title> <link href='/styles.css'Rel='stylesheet'> <link href='/images/favicon.png'Rel='shortcut icon'> <link href='/opensearch.xml'Rel='Search'title='Look up a Redis command'Type='APPLICATION/OPENSEARCHDESCRI<meta content='width=device-width, minimum-scale=1.0, maximum-scale=1.0'Name='Viewport'> <script>var _gaq= _gaq | | []; _gaq.push (['_setaccount','ua-20243082-1']); _gaq.push (['_trackpageview']); (function () {var ga= Document.createelement ('Script'); Ga.type ='Text/javascript'; Ga.async =true; GA.SRC= ('https:'= = Document.location.protocol?'Https://ssl':'http://www') +'. GOOGLE-ANALYTICS.Cvar s = document.getelementsbytagname ('Script') [0];       S.parentnode.insertbefore (GA, s);    })(); </script> class="'> <divclass='Mobile-menu Slideout-menu'> class='Menu-header'></Heade<! DOCTYPE html>"en"> "Content-type"Content="text/html; Charset=utf-8"/> <link rel="icon"Type="Image/x-icon"href="/favicon.ico"/> <link type="Text/css"href="/css/pages.css"Media=" All"Rel="stylesheet"> <!--Begin Jekyll SEO tag v2.2.0--><title>github Pages | Websites forYou andYour projects, hosted directly fromyour GitHub repository. Just Edit<meta property="Og:title"Content="GitHub Pages"/><meta property="Og:locale"Content="en_US"/><meta name="Description"Content="Websites for your and your projects, hosted directly from your GitHub repositor<meta property="og:description"Content="Websites for your and your projects, hosted directly from your GitHub re<link rel="Canonical"href="https://pages.github.com/"/><meta property="Og:url"Content="https://pages.github.com/"/><meta property="ogElapsed time:20.3339998722C +>

url_fetch_serial.py

ImportUrllib2Import Time#hosts = ["Https://apple.com", "https://ibm.com", "https://amazon.com"]hosts = ["Https://redis.io","Http://github.io"]start=time.time () forHostinchHosts:url=Urllib2.urlopen (host)PrintUrl.read (1024)Print "Elapsed Time:%s"% (Time.time ()-start)

Using Thread queues

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.