![](https://img-blog.csdnimg.cn/20201014180756918.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
学习笔记
文章平均质量分 58
无所事Sh1
这个作者很懒,什么都没留下…
展开
-
Python Socket 学习笔记
简易聊天 用网络调试助手接收 不知道怎么给外网发 计算机网络相关知识不足 亟待提高from socket import *from threading import Thread'''------------------------基本设置-----------------------------'''destIP =原创 2018-01-21 11:33:34 · 175 阅读 · 0 评论 -
Python 标准数据类型:bytes 【收藏】
Bytes 对象是由单个字节作为基本元素(8位,取值范围 0-255)组成的序列,为不可变对象。Bytes 对象只负责以二进制字节序列的形式记录所需记录的对象,至于该对象到底表示什么(比如到底是什么字符)则由相应的编码格式解码所决定。我们可以通过调用 bytes() 类(没错,它是类,不是函数)生成 bytes 实例,其值形式为 b'xxxxx',其中 'xxxxx' 为一至多个转义的十六转载 2018-01-21 19:31:05 · 747 阅读 · 0 评论 -
python pack 和unpack使用
# ref: http://blog.csdn.net/JGood/archive/2009/06/22/4290158.aspx import struct #pack - unpack print print '===== pack - unpack =====' str = struct.pack("ii", 20, 400) print 'str:转载 2018-01-21 19:50:57 · 11437 阅读 · 0 评论 -
Python爬美女图库
from bs4 import BeautifulSoup as bf import urllib.requestimport time#创建网址队列url_list = []for i in range(1,11): url = 'http://www.27270.com/tag/566_%d.html'%i url_list.append(url)for url原创 2018-01-26 13:09:43 · 1415 阅读 · 0 评论 -
Python简单静态服务器程序
import socketimport refrom multiprocessing import ProcessROOT_DIR = './html'def handle_client_socket(client_socket, client_address): print('[%s,%s]用户连接' % (client_address)) requ_data =原创 2018-01-27 09:49:59 · 384 阅读 · 0 评论 -
TFTP传输协议笔记
from socket import *import osimport structfileName = input('请输入要下载的文件:')dest = ('192.168.1.102',69)s = socket(AF_INET,SOCK_DGRAM)requestFileData = struct.pack('!H%dsb5sb'%len(fileName),1,fi原创 2018-01-21 21:45:57 · 352 阅读 · 0 评论 -
爬小学名称列表
import requestsimport bs4a = 2name = []headers = {'User-Agent':'Mozilla/5.0'}while a<=36: url = 'http://langfang.xuexiaodaquan.com/xiaoxue/pn%d.html'%a a+=1 html = request...原创 2018-05-29 09:03:02 · 182 阅读 · 0 评论 -
[转]np.random.Normal()
np.random.normal()正态分布在numpy计算中,一般会有:np.random.normal(size,loc,scale):loc:float此概率分布的均值(对应着整个分布的中心centre)scale:float此概率分布的标准差(对应于分布的宽度,scale越大越矮胖,scale越小,越瘦高)size:int or tuple of i...转载 2019-07-09 16:59:10 · 194 阅读 · 0 评论