自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(4)
  • 收藏
  • 关注

原创 2020-11-20

Python 编程快速上手filling the gaps编写一个程序,在一个文件夹中,找到所有带指定前缀的文件,诸如spam001.txt, spam002.txt等,并定位缺失的编号(例如存在spam001.txt和spam003.txt,但不存在spam002.txt)。让该程序对所有后面的文件改名,消除缺失的编号。》(摘自由 斯维加特(Al Sweigart), 王海鹏 撰写的《Python编程快速上手——让繁琐工作自动化(异步图书)》def copy_file(folder): whi

2020-11-20 12:17:08 124

原创 2020-11-10

Python 编程快速上手 疯狂填词import refile = open(‘panda.txt’, ‘w’ )file.write(‘The ADJECTIVE panda walked to the NOUN and then VERB. A nearby NOUN was affected by these events.’)file.close()file = open(‘panda.txt’)txt = file.read()file.close()txt_regex = re.

2020-11-10 15:52:04 103 1

原创 open() function

The open() function takes two parameters; filename, and mode.There are four different methods (modes) for opening a file:读"r" - Read - Default value. Opens a file for reading, error if the file does not exist追加"a" - Append - Opens a file for appending,

2020-11-03 22:03:18 301

原创 使用re.VERBOSE的一点注意事项

When converting your regex to re.VERBOSE mode make sure that:whitespace is escaped or replaced with some equivalent: \s or [ ] or '\ '(I had to put ‘’ here due to SO formatting). All plain whitespace is ignored with re.VERBOSE.hashes # are escaped or re

2020-10-24 20:01:34 1254

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除