2017年12月8日
摘要: 1 基于socketserver在服务器端实现执行cmd命令和上传文件(断点续传) 2 3 #server: 4 5 #!/usr/bin/env python 6 # -*- coding:utf-8 -*- 7 import subprocess 8 import socketserver 9 import os 10 11 BASEDIR = ... 阅读全文
posted @ 2017-12-08 08:29 悯尘 阅读(987) 评论(0) 推荐(0) 编辑
  2017年11月25日
摘要: 1 class Myclass: 2 def f1(self): 3 print(self.ip) 4 print(self.name) 5 print(self.pwd) 6 7 obj = Myclass() 8 obj.ip = '0.0.0.0' 9 obj.name = 'alex' 10 obj.pwd = ... 阅读全文
posted @ 2017-11-25 13:52 悯尘 阅读(117) 评论(0) 推荐(0) 编辑
  2017年11月24日
摘要: 1 import json 2 3 d = {"k1":123,"k2":"v2","k3":"v3"} 4 5 s = json.dumps(d) 6 print(s,type(s)) 7 #{"k1": 123, "k2": "v2", "k3": "v3"} 8 9 s = json.loads(s)#字符串内部必须为双引号 10 print(s,type(s)... 阅读全文
posted @ 2017-11-24 09:56 悯尘 阅读(129) 评论(0) 推荐(0) 编辑
  2017年11月23日
摘要: 1 #实现用户注册登陆 且密码为密文保存 2 #login_password_hash = hashlib.md5(bytes('自己的加密字节',encoding='utf-8')) 不会被撞库 3 4 5 6 import hashlib 7 while 1: 8 mesg = input('1登录2注册\n') 9 if mesg == '2': 1... 阅读全文
posted @ 2017-11-23 21:16 悯尘 阅读(149) 评论(0) 推荐(0) 编辑
摘要: import pickle dic = { 1001:{ 'name': 'Alex', 'sex': 'male', 'balance': 1000, 'bank_acc':{ 'ICBC': 10001, 'ABC': 10002 } }, ... 阅读全文
posted @ 2017-11-23 13:31 悯尘 阅读(117) 评论(0) 推荐(0) 编辑
摘要: #_*_coding:utf-8_*_ __author__ = 'Alex Li' import time # print(time.clock()) #返回处理器时间,3.3开始已废弃 , 改成了time.process_time()测量处理器运算时间,不包括sleep时间,不稳定,mac上测不出来 # print(time.altzone) #返回与utc时间的时间差,以秒计算\ ... 阅读全文
posted @ 2017-11-23 08:58 悯尘 阅读(120) 评论(0) 推荐(0) 编辑
  2017年11月22日
摘要: 123###!!!!!!!!!456 阅读全文
posted @ 2017-11-22 17:57 悯尘 阅读(320) 评论(0) 推荐(0) 编辑
摘要: def outer(func): def inner(*arg,**kwargs): print('#####') r = func(*arg,**kwargs) print('*****') return r return inner @outer def f(a,b): return a*b f(3,... 阅读全文
posted @ 2017-11-22 17:46 悯尘 阅读(255) 评论(0) 推荐(0) 编辑