会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
python学到老
博客园
首页
新随笔
联系
订阅
管理
1
2
3
4
下一页
2017年11月4日
上下文管理my_open
摘要: import queueimport contextlibq=queue.Queue()li=[]@contextlib.contextmanagerdef my_open(file_path,val): f=open(file_path,mode=val,encoding='utf-8') try
阅读全文
posted @ 2017-11-04 19:58 python学到老
阅读(166)
评论(0)
推荐(0)
2017年10月31日
设计模式
摘要: GOF设计模式 大话设计模式 单例模式
阅读全文
posted @ 2017-10-31 20:05 python学到老
阅读(93)
评论(0)
推荐(0)
try保护
摘要: try保护
阅读全文
posted @ 2017-10-31 20:04 python学到老
阅读(143)
评论(0)
推荐(0)
2017年10月30日
class类
摘要: class类 封装,继承,多态。 方法。 普通字段,静态字段,成员修饰符。 普通方法,类的方法。私有方法。
阅读全文
posted @ 2017-10-30 21:26 python学到老
阅读(104)
评论(0)
推荐(0)
反射
摘要: mk=__import__(模块) func=getattr(mk,n1)
阅读全文
posted @ 2017-10-30 07:11 python学到老
阅读(88)
评论(0)
推荐(0)
2017年10月29日
#!/usr/bin/env python
摘要: python脚本文件的第一行通常会写成如下的形式, !/usr/bin/python or !/usr/bin/env python 它们用于指定执行该脚本的解释器,如上即是指定python作为解释器。在计算机科学中这有个专门的术语,叫做shebang,可见其使用之广泛。 在计算机科学中,Sheba
阅读全文
posted @ 2017-10-29 22:30 python学到老
阅读(1770)
评论(0)
推荐(2)
发邮件
摘要: def email(): import smtplib from email.mime.text import MIMEText from email.utils import formataddr msg=MIMEText('老婆,我爱你','plain','utf-8') msg['From']
阅读全文
posted @ 2017-10-29 21:22 python学到老
阅读(156)
评论(0)
推荐(0)
yield生成器
摘要: def func(): print(1) yieldfunc().__next__()func().__next__()func().__next__()
阅读全文
posted @ 2017-10-29 18:53 python学到老
阅读(109)
评论(0)
推荐(0)
logging
摘要: import logging ,time,datetimelogging.basicConfig(filename='日志.log', format='%(asctime)s-%(name)s-%(levelname)s-%(module)s:%(message)s ', datefmt='%Y-%
阅读全文
posted @ 2017-10-29 18:33 python学到老
阅读(128)
评论(0)
推荐(0)
format格式化字符串
摘要: format格式化字符串
阅读全文
posted @ 2017-10-29 18:28 python学到老
阅读(98)
评论(0)
推荐(0)
1
2
3
4
下一页
公告