This file contains 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
pip config set global.index-url https://mirrors.aliyun.com/pypi/simple |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains 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
# coding: utf-8 | |
import logging | |
import threading | |
from queue import Queue | |
logger = logging.getLogger() | |
logger.setLevel(logging.DEBUG) | |
formatter = logging.Formatter('%(asctime)s - %(message)s') | |
ch = logging.StreamHandler() |
This file contains 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
import asyncio | |
import aiohttp | |
import bs4 | |
import tqdm | |
import re | |
allBook = [] #init allbook index | |
@asyncio.coroutine |
This file contains 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
import asyncio | |
import aiohttp | |
import bs4 | |
import tqdm | |
@asyncio.coroutine | |
def get(*args, **kwargs): | |
response = yield from aiohttp.request('GET', *args, **kwargs) | |
return (yield from response.read_and_close(decode=True)) |
This file contains 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
# -*- coding: utf-8 -*- | |
#------------------------------------------------------------------------- | |
# Name: The-Swift-Programming-Language | |
# Purpose: Web crawler of Swift, Python is slow------- | |
# | |
# Author: [email protected] | |
# | |
# Created: 10/27/2014 | |
# Copyright: (c) muxuezi 2014 | |
# Licence: <All licence> |
This file contains 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
# -*- coding: utf-8 -*- | |
import urllib2 | |
import thread | |
import Queue | |
import time | |
from bs4 import BeautifulSoup | |
def findlen(item): | |
url = 'http://dongxi.douban.com/doulists/%s/?start=0' % (item) |
This file contains 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
/*The "right-left" rule is a completely regular rule for deciphering C | |
declarations. It can also be useful in creating them. | |
First, symbols. Read | |
* as "pointer to" - always on the left side | |
[] as "array of" - always on the right side | |
() as "function returning" - always on the right side | |
as you encounter them in the declaration. |
This file contains 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
""" | |
delete all .pyc bytecode files in a directory tree: use the | |
command line arg as root if given, else current working dir | |
""" | |
import os, sys | |
rootdir = os.getcwd() if len(sys.argv) < 2 else sys.argv[1] | |
findonly = False if len(sys.argv) < 3 else int(sys.argv[2]) | |
found = removed = 0 |
This file contains 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
%-- Thanks Ben Nadel for his blog http://www.bennadel.com/blog/2074-seven-languages-in-seven-weeks-prolog-day-3.htm | |
%-- I am the 9x9 solution. | |
%-- Empty boards are valid. | |
valid( [] ). | |
%-- The sets are valid if each set contains unique values. | |
valid([Head|Tail]) :- | |
fd_all_different(Head), | |
valid(Tail). |