随笔分类 -  python 常用方法

python常用的方法,坑点,容易忘的
摘要:1、循环中,continue是跳出当前循环,进行下次循环,break是跳出整个循环(不再进行循环) 2、eval()函数可以将字符串中的数据结构提取出来,也可以在字符串中进行数学运算 3、sys.stdout.write() 相当于print sys.stdout.flush() 立即打印 4、** 阅读全文
posted @ 2018-06-21 02:29 BensonChang 阅读(205) 评论(0) 推荐(0)
摘要:列表删除方法: 记不住的方法: table = 'username\tpassword\temail\nbenson\t123\tdf@qq.com\nbenson\t123\tdf@qq.com\n'print(table.expandtabs(20)) >>> username password 阅读全文
posted @ 2018-06-12 17:04 BensonChang 阅读(195) 评论(0) 推荐(0)