Python
新手小白python笔记
小轩窗Candy
这个作者很懒,什么都没留下…
展开
-
AttributeError: module ‘win32com.gen_py.00062FFF-0000-0000-C000-000000000046x0x9x6‘ has no attribute
记录下关于AttributeError: module ‘win32com.gen_py.00062FFF-0000-0000-C000-000000000046x0x9x6’ has no attribute 'CLSIDToClassMap’报错的解决方法:在类似如下目录找到对应的文件(一大坨类似00000)命名的文件夹/文件删除即可C:\Users\chuang\AppData\Local\Temp\gen_py\3.9...原创 2021-10-18 17:52:51 · 469 阅读 · 0 评论 -
Python: 查找文件夹中的文件并写入txt
import osfilepath=r'\\10.2.1.214\Data\Oracle\BillingFile_by_SO1\\'with open('python.txt','w',encoding='utf-8') as f: for root,dirs,files in os.walk(filepath): for name in files: f.write(os.path.join(root,name)+'\n') # fo原创 2021-08-26 14:57:38 · 169 阅读 · 0 评论 -
Python 安装 win32com模块
cmd 进入python -m pip install pypiwin32原创 2021-07-12 16:11:54 · 960 阅读 · 0 评论 -
Python: 获取文件路径中最新的文件+lamba函数
def new_file(path1):lists = os.listdir(path1)lists.sort(key= lambda f: os.path.getmtime(path1 + ‘\’ + f))file_path = os.path.join(path1, lists[-1])return file_pathlambda函数也叫匿名函数,即,函数没有具体的名称。key=lambda fn:os.path.getmtime(test_dir+’\’+fn)#相当于def key原创 2021-07-09 14:39:07 · 258 阅读 · 0 评论