Chinaunix首页 | 论坛 | 博客
  • 博客访问: 9148282
  • 博文数量: 1726
  • 博客积分: 12961
  • 博客等级: 上将
  • 技术积分: 19850
  • 用 户 组: 普通用户
  • 注册时间: 2009-01-09 11:25
个人简介

偷得浮生半桶水(半日闲), 好记性不如抄下来(烂笔头). 信息爆炸的时代, 学习是一项持续的工作.

文章分类

全部博文(1726)

文章存档

2024年(2)

2023年(26)

2022年(112)

2021年(217)

2020年(157)

2019年(192)

2018年(81)

2017年(78)

2016年(70)

2015年(52)

2014年(40)

2013年(51)

2012年(85)

2011年(45)

2010年(231)

2009年(287)

发布时间:2018-01-12 11:01:38

二进制字节流的拆解包:1. 使用 struct 点击(此处)折叠或打开#获取字节流的 包大小域 PkgSizeStruct = struct.Struct("!l") 预定义一个存储格式一定的结构体对象。size_data = sock.recv(PkgSizeStruct。size)现充socket中读出包大小的字节流.........【阅读全文】

阅读(2000) | 评论(0) | 转发(0)

发布时间:2018-01-11 14:50:54

多进程模块:subprocess 模块, 实现多进程要求。提供了运行其他程序的功能, 可以传递命令行参数, 可以通过管道进行通信。同时也有 spawn函数、os.system()等内容。sys.executable 代表当前运行的python解释器。点击(此处)折叠或打开pipe = subprocess.Popen(cmdline, stdin=subprocess.PIPE)  #.........【阅读全文】

阅读(2306) | 评论(0) | 转发(0)

发布时间:2018-01-10 13:39:27

自定义类:点击(此处)折叠或打开class classname:   suiteclass classname(base_classes):   suite最基类为 object, 其包含 __new__  __init__  __eq__  __repr__  __str__ 等方法属性.........【阅读全文】

阅读(1542) | 评论(0) | 转发(0)

发布时间:2018-01-09 17:15:35

模块的搜索路径: 1. 首先从 sys.path中寻找,   2. 从 环境变量 PYTHONPATH中寻找.模块导入: 会导入模块的所有对象,包括变量, 函数,数据类型和子模块,  除了以下划线引导的对象(私有对象)import importableimport importable1, importable1, importable2...import importable as preferred_name  #.........【阅读全文】

阅读(1001) | 评论(0) | 转发(0)

发布时间:2018-01-05 14:40:19

点击(此处)折叠或打开if bool_expr1:suite1elif bool_expr2:suite2else:suite_else缩编方式expr1 if bool_expr else expr2综合示例 print("{0} f.........【阅读全文】

阅读(1363) | 评论(0) | 转发(0)
给主人留下些什么吧!~~
留言热议
请登录后留言。

登录 注册