随笔分类 -  Python权威指南

Ubuntu Redis 安装篇
摘要:1.在线安装 apt-get install redis 安装完 redis-server 启动 redis-cli 进入redis 在线安装一般用于测试学习,因为安装路径,配置等信息没有详细介绍,本篇主要介绍用源码安装。 2.源码安装 cd /usr/local/src 跳转到源码目录 wget 阅读全文

posted @ 2020-02-21 22:07 迎着风追赶 阅读(184) 评论(0) 推荐(0)

python 装饰器之应用示例
摘要:import time import hashlib import pickle import threading #装饰函数缓存应用 cache ={} def is_obsolete(entry,duration): return time.time() - entry['time']>duration def compute_key(function,args,kw): key = pick 阅读全文

posted @ 2019-12-02 23:16 迎着风追赶 阅读(202) 评论(0) 推荐(0)

Python-sokect 示例
摘要:server: #coding=utf-8 import socket _sokect =socket.socket() #创建sokect _host =socket.gethostname() #获取本地主机名 _port =8090 #设置端口 _sokect.bind((_host,_port)) _sokect.listen(5) #等待客户端连接 while True: client, 阅读全文

posted @ 2019-11-29 14:55 迎着风追赶 阅读(177) 评论(0) 推荐(0)

Python装饰器
摘要:this is a some_static_methodfoothis is a some_class_methodfoo 阅读全文

posted @ 2019-10-08 23:07 迎着风追赶 阅读(171) 评论(0) 推荐(0)

导航