摘要: '''使用装饰器对文件进行读写操作''' # def check_permission(func): # '''演示嵌套函数定义及使用''' # def wrapper(*args,**kwargs): # '''*args:接收任意多个实参并存入元组中;**kwargs:接收关键字参数显示赋值并存入字典中''' # if kwargs.get('... 阅读全文
posted @ 2018-06-08 20:00 goodTOgreat 阅读(514) 评论(0) 推荐(0) 编辑
摘要: #!/user/bin/env python # @Time :2018/6/5 14:58 # @Author :PGIDYSQ #@File :PyCheck.py from os.path import isfile as isfile from time import time as time Result ={} AllLines =[] FileName = ... 阅读全文
posted @ 2018-06-08 19:58 goodTOgreat 阅读(708) 评论(0) 推荐(0) 编辑
摘要: #!/user/bin/env python # @Time :2018/6/6 10:10 # @Author :PGIDYSQ #@File :FileBackup2.py import os import filecmp import shutil import sys import time,sched '''定时任务备份,增量备份''' schedule = ... 阅读全文
posted @ 2018-06-08 19:57 goodTOgreat 阅读(1972) 评论(0) 推荐(0) 编辑
摘要: #!/user/bin/env python # @Time :2018/6/7 16:31 # @Author :PGIDYSQ #@File :PerformTaskTimer.py #定时执行任务命令 #1.定时任务代码 import time,os,sched # schedule = sched.scheduler(time.time,time.sleep) # ... 阅读全文
posted @ 2018-06-08 19:57 goodTOgreat 阅读(15364) 评论(0) 推荐(0) 编辑
摘要: '''自定义数组类,实现数组中数字之间的四则运算,内积运算,大小比较,数组元素访问修改及成员测试等功能''' class MyArray: '''保证输入值为数字元素(整型,浮点型,复数)''' def ___isNumber(self, n): if not isinstance(n,(int,float,complex)): retur... 阅读全文
posted @ 2018-06-08 19:54 goodTOgreat 阅读(6145) 评论(0) 推荐(0) 编辑
摘要: #!/user/bin/env python # @Time :2018/6/8 14:44 # @Author :PGIDYSQ #@File :CreateFunTest.py '''如何在sqlite3连接中创建并调用自定义函数''' import sqlite3,hashlib #自定义函数 def md5sum(t): return hashlib.md5... 阅读全文
posted @ 2018-06-08 19:52 goodTOgreat 阅读(1710) 评论(0) 推荐(0) 编辑