python
InversionOfLaziness
Sometimes ever, sometimes never.
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
python遍历文件夹下文件,删除指定后缀文件或保留指定后缀文件,删除空文件夹
import osdef delWithCmd(path): try: if os.path.isfile(path): cmd = 'del "' + path + '" /F' os.system(cmd) except Exception as e: print(e)def del_files(path, delend): for root, dirs, files in os.wal原创 2021-06-22 16:39:42 · 1855 阅读 · 1 评论 -
报错及解决 ‘gbk‘ codec can‘t decode byte 0x80 和raise ImportError(‘Failed to initialize: {0}‘.format(exc)
在使用GitPython包准备爬git文件遇到了好多问题,现记录下解决方案情况1File “D:\Anaconda\lib\subprocess.py”, line 1238, in _readerthreadbuffer.append(fh.read())UnicodeDecodeError: ‘gbk’ codec can’t decode byte 0x80 in position 41: illegal multibyte sequence解决方案:这个只需要点进subprocess.p原创 2021-06-22 03:23:40 · 2245 阅读 · 2 评论
分享