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
| #!/usr/bin/env python | |
| # -*- coding: utf-8 -*- | |
| # Author: Ficapy | |
| # Create: '15/10/27' | |
| from pyquery import PyQuery as pq | |
| from operator import attrgetter | |
| from concurrent.futures import ThreadPoolExecutor, as_completed | |
| from operator import methodcaller | |
| import requests |
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
| #!/usr/bin/env python | |
| # -*- coding: utf-8 -*- | |
| # Author: Ficapy | |
| from __future__ import division, print_function | |
| import sys | |
| import re | |
| import urllib | |
| import sqlite3 | |
| import tempfile |
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
| #!/usr/bin/env python | |
| # -*- coding: utf-8 -*- | |
| # Author: Ficapy | |
| import requests | |
| import base64 | |
| import hmac | |
| import os | |
| import sys | |
| import datetime |
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
| from concurrent.futures import ThreadPoolExecutor, as_completed | |
| from user_agent import generate_user_agent | |
| import requests | |
| from pyquery import PyQuery as pq | |
| def singal_parse(id): | |
| url = 'http://www.miaoss.net/reg.php?id={}'.format(id) | |
| ret = requests.get(url, params={'User-Agent': generate_user_agent()}, timeout=30) | |
| ret.encoding = 'utf-8' |
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
| total = 2292627 | |
| import sys | |
| import codecs | |
| from encodings.aliases import aliases | |
| import mmap | |
| all_encoding = aliases.values() | |
| all_encoding = list(set(all_encoding)) | |
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
| # http://stackoverflow.com/questions/18337407/saving-utf-8-texts-in-json-dumps-as-utf8-not-as-u-escape-sequence | |
| print(json.dumps({u'卧槽': u'卧槽'}, indent=4).decode('unicode-escape').encode('utf8')) | |
| print(json.dumps({u'卧槽': u'卧槽'}, indent=4, ensure_ascii=False)) |
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
| import random | |
| from tt import retrys | |
| def g(): | |
| pass | |
| class A(): | |
| def __init__(self): |
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
| class A(object): | |
| pass | |
| a = A() | |
| # 给类添加方法 | |
| def baz(self): | |
| print('baz') | |
| A.baz = baz | |
| # ==========或者 |
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
| import codecs | |
| import re | |
| import mmap | |
| with codecs.open('a.txt', 'r+', 'utf-8') as f: | |
| data = mmap.mmap(f.fileno(), 0) | |
| print(re.findall(b'AccountType\=(.*)', data)) |
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
| #!/usr/bin/env python | |
| # -*- coding: utf-8 -*- | |
| # Author: Ficapy | |
| # Create: '15/8/6' | |
| import time | |
| import math | |
| import requests | |
| from concurrent.futures import ThreadPoolExecutor, as_completed | |
| from xlrd import open_workbook |