This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""Comparison of fetching web pages sequentially vs. asynchronously | |
Requirements: Python 3.5+, Requests, aiohttp, cchardet | |
For a walkthrough see this blog post: | |
http://mahugh.com/2017/05/23/http-requests-asyncio-aiohttp-vs-requests/ | |
""" | |
import asyncio | |
from timeit import default_timer |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""Demonstrate how to execute parallel http get requests with requests in asyncio""" | |
import asyncio | |
import concurrent.futures | |
import requests | |
num_requests = 20 | |
# Example 1: synchronous requests | |
def example_1(): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
演示如何使用python-docx创建团体报告 | |
""" | |
import functools | |
import itertools | |
import operator | |
from docx import Document | |
from docx.table import Table |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <cstdlib> | |
#include <iostream> | |
#include <vector> | |
#include <string> | |
#include <cstring> | |
#include <iterator> | |
#include <algorithm> | |
#include <math.h> | |
#include <sstream> | |
#include <cmath> |