上一页 1 ··· 13 14 15 16 17
摘要: #无参数 #show() 》show() #一个参数 def show(arg): print(arg) show('kkk') #两个参数 def show(arg,xx): print(arg,xx) show('kkk','77') #默认参数,必须放在最后 def show(a1,a2=99 阅读全文
posted @ 2017-01-24 13:03 张兮兮 阅读(130) 评论(0) 推荐(0) 编辑
摘要: def mail(): n=123 n+=1 print(n) return 1 mail() 执行 # import smtplib from email.mime.text import MIMEText from emial.utils import formataddr def mail(u 阅读全文
posted @ 2017-01-24 11:40 张兮兮 阅读(118) 评论(0) 推荐(0) 编辑
该文被密码保护。 阅读全文
posted @ 2017-01-19 16:54 张兮兮 阅读(1) 评论(0) 推荐(0) 编辑
摘要: collection 类 dic=collections.OrderedDict()//有序字典 //dic=dict() dic['k1']='v1' dic['k2']='v2' dic['k3']='v3' print(dic) dic.move_to_end('k1')//把第一个移到最后 阅读全文
posted @ 2017-01-19 11:46 张兮兮 阅读(153) 评论(0) 推荐(0) 编辑
摘要: #int函数 a=10 m=a.__divmod__(3 ) print(m) (3, 1)m=a.__floordiv__(6) print(m) 1b=float(a) print(b) 10.0 #str函数 dir查看成员:a=dir(str) print(a)['__add__', '__ 阅读全文
posted @ 2016-12-11 18:50 张兮兮 阅读(193) 评论(0) 推荐(0) 编辑
上一页 1 ··· 13 14 15 16 17