2018年3月27日

Python_41datetime模块

摘要: import time import datetime print (time.clock()) 返回处理器时间 print (time.time()) 返回当前系统时间戳 print (time.ctime()) 输出带有星期 日历 时间的当前系统时间 print (time.ctime(time 阅读全文

posted @ 2018-03-27 10:17 JuGooLar 阅读(93) 评论(0) 推荐(0) 编辑

2018年3月13日

Python_40Sys模块

摘要: sys.argv 命令行参数LIst,第一个元素是程序本身路径 sys.exit(n) 退出程序,正常退出exit(0) sys.version 获取Python解释程序的版本信息 sys.maxint 最大Int值 sys.path 返回模块的搜索路径,初始化时使用PYTHONPATH环境变量的值 阅读全文

posted @ 2018-03-13 20:47 JuGooLar 阅读(119) 评论(0) 推荐(0) 编辑

Python_39Time模块

摘要: 模块的工能:工作模块化 Python有非常丰富的模块库; Python有自带的库200-300多个 Python常用的库 time & 模块:做时间转换的。 ———————————— 1520933656.788 时间戳 从1970年1月1日开始计时 到现在有多少秒了 time.ctime() Tu 阅读全文

posted @ 2018-03-13 17:54 JuGooLar 阅读(125) 评论(0) 推荐(0) 编辑

Python_38正则表达式计算器

摘要: 正则表达式:'\a'是一个响铃符 BEL ‘\b’ 是退格特殊字符 阅读全文

posted @ 2018-03-13 17:04 JuGooLar 阅读(102) 评论(0) 推荐(0) 编辑

2018年3月2日

Python_37正则表达式

摘要: 正则表达式:本身也是一门语言 字符串的方法: find 返回的是位置 ‘abdcdd’.find('b') 返回b的位置 split 分割字符串 replace 替换 正则表达式是给现有方法基础上添加功能 有一定规则的功能 正则表达式的功能: 字符匹配: 普通字符匹配配: re.findall('a 阅读全文

posted @ 2018-03-02 16:55 JuGooLar 阅读(176) 评论(0) 推荐(0) 编辑

2018年2月28日

Python_36用户名密码登录注册的例子

摘要: def panduan (username,passwd):#验证用户米明码是否存在 with open('G:\liumang.txt','r+',encoding='utf-8')as f: for line in f: line=line.strip() usernamepasswd=line 阅读全文

posted @ 2018-02-28 15:25 JuGooLar 阅读(181) 评论(0) 推荐(0) 编辑

2018年2月27日

Python_35有多个装饰器装饰一个函数

摘要: 多个装饰器的使用 123('d', 'f'){}df123('d', 'f', 'g'){}df 阅读全文

posted @ 2018-02-27 16:41 JuGooLar 阅读(166) 评论(0) 推荐(0) 编辑

Python_34有N个参数的装饰器

摘要: hellohellohellohellohelloFFFF3 不改变原来函数结果的基础上添加参数 变参数个数的函数 可以让函数接受任意个参数 用(*arg) 可以输入任意个同一类型的参数 用( *arg,**kwargs)可以输入任意万能参数各种类型 def f1(*arg,**kwargs): p 阅读全文

posted @ 2018-02-27 16:07 JuGooLar 阅读(115) 评论(0) 推荐(0) 编辑

2018年2月24日

Python_33装饰器

摘要: 装饰器 开放封闭原则 装饰器是方法、类等 hellohellohellohellohelloF1 装饰器的使用 1.@函数名(f) 执行函数名(f),并将接下来的函数名(f1)不加括号当做参数 2、将函数名(f(f1))的返回值重新赋值给函数名(f1) 函数没有返回值时默认返回NULL helloh 阅读全文

posted @ 2018-02-24 16:36 JuGooLar 阅读(114) 评论(0) 推荐(0) 编辑

Python_32递归

摘要: 1、递归 本身调用自己,直到遇见不满足条件的阈值 斐波那契数列 li=[] li[n]=li[n-1]+li[n-2] def f(a1,a2): a3=a1+a2 f(a2,a3) 阅读全文

posted @ 2018-02-24 15:16 JuGooLar 阅读(80) 评论(0) 推荐(0) 编辑

导航