会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
wayens
博客园
首页
新随笔
联系
订阅
管理
2018年1月23日
python - 文件操作
摘要: 一、打开文件 1,import os context = "hello world! \n you are welecome !!!" 2,f = open('hello.txt','w',encoding= 'gbk') 3,f.write(context) 4,f.close() 二、文件读取
阅读全文
posted @ 2018-01-23 16:24 wayens
阅读(145)
评论(0)
推荐(0)
2017年12月30日
python - 内置函数
摘要: 1,shutil拷贝函数 用法: import shutil >> shutil.copyfile(fsrc, dst) >> shutil.rmtree('delfile') 2, os,sys.path 1)查看当前路径 >>> os.getcwd() 2)更改路径 >>> os.chdir('
阅读全文
posted @ 2017-12-30 22:19 wayens
阅读(102)
评论(0)
推荐(0)
2017年12月27日
python - datetime
摘要: 1,python中时间日期格式化符号: 2, 时间类型转字符串 time.strftime(fmt[,tupletime]) 3,字符串转时间类型 time.strptime(str,fmt='%Y-%m-%d %H:%M:%S ') 4,str 转 datetime 5, datetime 转st
阅读全文
posted @ 2017-12-27 16:50 wayens
阅读(83)
评论(0)
推荐(0)
python -PrettyTable
摘要: python -PrettyTable 格式化展示 1,导入库 import prettytable 2,定义展示对象 row = prettrytable.PrettyTable() 3,添加标题头 row.filed_names=['查看可用额度','查看消费记录','还款','提现','转账'
阅读全文
posted @ 2017-12-27 11:43 wayens
阅读(195)
评论(0)
推荐(0)
python-logging用法
摘要: 1,引入logging 程序包 import logging 2,定义一个logging对象 logger = logging.getLogger('logger_name') #给该对象分配一个对象名:logger_name 3,给logger对象设置日志级别: logger.setLevel(l
阅读全文
posted @ 2017-12-27 11:25 wayens
阅读(144)
评论(0)
推荐(0)
公告