摘要: # -*- coding: utf-8 -*- """requests.session~~~~~~~~~~~~~~~~ This module provides a Session object to manage and persist settings acrossrequests (cooki 阅读全文
posted @ 2018-08-10 13:36 tny_leyon 阅读(593) 评论(0) 推荐(0) 编辑
摘要: # encoding:utf-8 _portprog = None def split_host_port(host): """ split the host :param host: host like : xxxx.80 :return: host,port """ global _portpr 阅读全文
posted @ 2018-08-10 08:44 tny_leyon 阅读(122) 评论(0) 推荐(0) 编辑
摘要: # encoding:utf-8# baseic usage of requests.sessionsimport requestsfrom requests import sessions r = requests.Request('GET', 'http://172.21.2.3:8009/ad 阅读全文
posted @ 2018-08-10 08:43 tny_leyon 阅读(138) 评论(0) 推荐(0) 编辑
摘要: # encoding:utf-8 from collections import OrderedDictfrom collections import MutableMappingfrom threading import RLock _Null = object() def iterkeys(d, 阅读全文
posted @ 2018-08-10 08:42 tny_leyon 阅读(279) 评论(0) 推荐(0) 编辑
摘要: import sys builtin_str = strver = sys.versionis_py2 = int(ver[0]) == 2is_py3 = int(ver[0]) == 3 def to_native_string(string, encoding='ascii'): """Giv 阅读全文
posted @ 2018-08-10 08:40 tny_leyon 阅读(148) 评论(0) 推荐(0) 编辑
摘要: # encoding:utf-8class LookupDict(dict): """Dictionary lookup object.""" def __init__(self, name=None): self.name = name super(LookupDict, self).__init 阅读全文
posted @ 2018-08-10 08:39 tny_leyon 阅读(322) 评论(0) 推荐(0) 编辑
摘要: def iter_slices(string, slice_length): """Iterate over slices of a string.""" pos = 0 if slice_length is None or slice_length <= 0: slice_length = len 阅读全文
posted @ 2018-08-10 08:35 tny_leyon 阅读(210) 评论(0) 推荐(0) 编辑
摘要: # encoding:utf-8 import sslfrom requests import sessionsfrom requests import Requestfrom requests.adapters import HTTPAdapterfrom requests.packages.ur 阅读全文
posted @ 2018-08-10 08:32 tny_leyon 阅读(294) 评论(0) 推荐(0) 编辑