一、概述 所谓断点续传,其实只是指下载,也就是要从文件已经下载的地方开始继续下载。在以前版本的HTTP协议是不支持断点的,HTTP/1.1开始就支持了。一般断点下载时才用到Range和Content-Range实体头。HTTP协议本身不支持断点上传,需要自己实现。 二、Range 用于请求头中,指定 ...
分类:
Web程序 时间:
2020-05-08 12:46:38
阅读次数:
65
from threading import Thread g_num = 0 def test1(): global g_num for i in range(1000000): g_num += 1 print(" test1 g_num=%d"%g_num) def test2(): globa ...
分类:
编程语言 时间:
2020-05-07 21:24:41
阅读次数:
75
from multiprocessing import Pool import os,time,random def worker(msg): start_time = time.time() print("(%s)开始执行,进程号为(%s)"%(msg,os.getpid())) time.sle ...
分类:
编程语言 时间:
2020-05-07 21:24:09
阅读次数:
72
对Series 对象使用匿名函数 使用 pipe 函数对 Series 对象使用 匿名函数 pd.Series(range(5)).pipe(lambda x,y,z :(x**y)%z,2,5) pd.Series(range(5)).pipe(lambda x:x+3).pipe(lambda ...
分类:
其他好文 时间:
2020-05-07 20:15:20
阅读次数:
93
# 一维数组与常用操作 import pandas as pd # 设置输出结果列对齐 pd.set_option('display.unicode.ambiguous_as_wide',True) pd.set_option('display.unicode.east_asian_width',T ...
分类:
编程语言 时间:
2020-05-07 20:10:31
阅读次数:
158
import numpy as np n = np.arange(10) # array([0, 1, 2, 3, 4, 5, 6, 7, 8, 9]) # 查看数组的大小 n.size # 10 # 将数组分为两行五列 n.shape = 2,5 ''' array([[0, 1, 2, 3, 4 ...
分类:
编程语言 时间:
2020-05-07 20:06:52
阅读次数:
102
# 导入numpy 并赋予别名 np import numpy as np # 创建数组的常用的几种方式(列表,元组,range,arange,linspace(创建的是等差数组),zeros(全为 0 的数组),ones(全为 1 的数组),logspace(创建的是对数数组)) # 列表方式 n ...
分类:
编程语言 时间:
2020-05-07 19:48:22
阅读次数:
101
# 时间序列和常用操作 import pandas as pd # 每隔五天--5D pd.date_range(start = '20200101',end = '20200131',freq = '5D') ''' DatetimeIndex(['2020-01-01', '2020-01-06 ...
分类:
其他好文 时间:
2020-05-07 19:30:10
阅读次数:
85
'验证码生成' import numpydef list_connect(*lists): result=[] try: for i in lists: if type(result)!=type(i): #判断入参是否均为列表,如果不是则抛出异常,中断程序 raise TypeError('参数{ ...
分类:
其他好文 时间:
2020-05-07 15:50:44
阅读次数:
60
一 前言 本篇主讲内容为python基础模块random库的基本使用,读者熟悉基本用法即可,需要特殊要求查询官方文档即可 公众号: 知识追寻者 知识追寻者(Inheriting the spirit of open source, Spreading technology knowledge;) 二 ...
分类:
编程语言 时间:
2020-05-07 15:18:36
阅读次数:
67