上一页 1 ··· 33 34 35 36 37 38 39 40 41 ··· 45 下一页
摘要: 链接地址:https://www.cnblogs.com/sunlong88/articles/9384920.html 关于array: Python 本身没有数组这个说法, 有的就是list和tuple, list就具有其他语言中的数组特性. 至于list和tuple的区别,在于list可以在运 阅读全文
posted @ 2019-12-16 01:38 就是想学习 阅读(1632) 评论(0) 推荐(0)
摘要: import collections Card = collections.namedtuple('Card', 'rank suit') class Frenchdeck: ranks = [str(n) for n in range(2, 11)] + list('JQKA') # 把牌的数字与 阅读全文
posted @ 2019-12-15 15:52 就是想学习 阅读(287) 评论(0) 推荐(0)
摘要: Python中又一个名称叫一等对象,满足以下条件的程序实体: 1、在运行时创建 2、能赋值给变量或数据结构中的元素 3、能作为参数传给函数 4、能作为函数的返回结果 所以Python中,正数、字符串、字典与函数都是一等对象。 5.1把函数当做对象: 把函数当做对象,通过简单的__doc__可以输出函 阅读全文
posted @ 2019-12-15 14:42 就是想学习 阅读(339) 评论(0) 推荐(0)
摘要: 如果我们想要限制实例的属性,Python允许在定义class的时候,定义一个特殊的slots变量,来限制该class实例能添加的属性。 使用slots要注意,slots定义的属性仅对当前类实例起作用,对继承的子类是不起作用的 除非在子类中也定义slots,这样,子类实例允许定义的属性就是自身的slo 阅读全文
posted @ 2019-12-15 14:41 就是想学习 阅读(394) 评论(0) 推荐(1)
摘要: 参考链接: https://www.cnblogs.com/CJOKER/p/8295272.html https://www.cnblogs.com/deeper/p/7404190.html https://www.jianshu.com/p/feb86c06c4f4 https://zhuan 阅读全文
posted @ 2019-12-11 01:36 就是想学习 阅读(890) 评论(0) 推荐(1)
摘要: 老样子,先上参考连接: https://www.cnblogs.com/jiangfan95/p/11439543.html https://www.liaoxuefeng.com/wiki/1016959663602400/1017629247922688 https://blog.csdn.ne 阅读全文
posted @ 2019-12-11 00:24 就是想学习 阅读(1050) 评论(0) 推荐(1)
摘要: 更新与2020年11月30日 首先是通过os.fork创建多进程: 官方文档:https://docs.python.org/zh-cn/3/library/multiprocessing.html#module-multiprocessing 参考链接: https://www.cnblogs.c 阅读全文
posted @ 2019-12-11 00:04 就是想学习 阅读(947) 评论(0) 推荐(0)
摘要: 没有前端,多开了一条线程用于接收信息。 服务器端: # -*- coding:utf-8 -*- import socket import threading class Sock_Server: def __init__(self): self.host = '192.168.1.11' # 获取 阅读全文
posted @ 2019-12-07 23:06 就是想学习 阅读(417) 评论(0) 推荐(0)
摘要: class Demo: def __init__(self, x, y, z): self.x = x self.y = y self.z = z @property def all_sum(self): # 方法转属性 return self.x + self.y +self.z def __lt 阅读全文
posted @ 2019-12-05 01:06 就是想学习 阅读(1200) 评论(0) 推荐(0)
摘要: # -*- coding: utf8 -*- set1 = set('abcd') set2 = set('cdef') print(set1 - set2) # 差集 set1相对与set2 多什么 print(set2 - set1) print(set1 | set2) # 并集,两个集合合并 阅读全文
posted @ 2019-12-04 21:13 就是想学习 阅读(171) 评论(0) 推荐(0)
上一页 1 ··· 33 34 35 36 37 38 39 40 41 ··· 45 下一页