wordpress建站图片效果,wordpress 删除版权信息,建大网络,网页设计公司注册最近做了一个软件#xff0c;准备去申请软件著作书#xff0c;看着那60页的文档#xff0c;确实难搞#xff0c;不过幸好会用一点点python#xff0c;就自己用python写了一个读取所有文件代码的程序#xff0c;使用起来也很简单#xff0c;过来分享一下
链接#xff1…最近做了一个软件准备去申请软件著作书看着那60页的文档确实难搞不过幸好会用一点点python就自己用python写了一个读取所有文件代码的程序使用起来也很简单过来分享一下
链接https://pan.baidu.com/s/1rosw7H2-vMNmtmr7gMXxHw?pwdm5tt
提取码m5tt展示 可以对于文件夹进行选择 中间不写就是读取全部文件写了就可以读取指定格式文件点击搜索 然后选择最下面的按钮 轻松完成代码编写,会自动去除空行
主要代码
def select_directory():global directory_pathdirectory_path filedialog.askdirectory()directory_entry.delete(0, tk.END)directory_entry.insert(0, directory_path)def search_files():files_listbox.delete(0, tk.END)if not directory_path:returnfile_types file_type_entry.get().split(;)if len(file_types) 1 and file_types[0] :file_types Nonefor root, dirs, files in os.walk(directory_path):for file in files:if file_types is None or file.lower().endswith(tuple(file_types)):files_listbox.insert(tk.END, os.path.join(root, file))def write_to_txt():directory directory_entry.get()save_path filedialog.asksaveasfilename(defaultextension.txt, filetypes[(Text files, *.txt)])if not directory or not save_path:returnwith open(save_path, w, encodingutf-8) as output_file:for i in range(files_listbox.size()):file_path files_listbox.get(i)with open(file_path, r, encodingutf-8) as f:content f.readlines() # 按行读取文件内容content [line.strip() for line in content if line.strip()] # 去除空行if content:output_file.write(fFile: {file_path}\n)output_file.write(\n.join(content) \n\n) 文章转载自: http://www.morning.hbkkc.cn.gov.cn.hbkkc.cn http://www.morning.byzpl.cn.gov.cn.byzpl.cn http://www.morning.gwwtm.cn.gov.cn.gwwtm.cn http://www.morning.807yy.cn.gov.cn.807yy.cn http://www.morning.qrpx.cn.gov.cn.qrpx.cn http://www.morning.jsphr.cn.gov.cn.jsphr.cn http://www.morning.rdng.cn.gov.cn.rdng.cn http://www.morning.bkfdf.cn.gov.cn.bkfdf.cn http://www.morning.qygfb.cn.gov.cn.qygfb.cn http://www.morning.qlckc.cn.gov.cn.qlckc.cn http://www.morning.jzfxk.cn.gov.cn.jzfxk.cn http://www.morning.hfxks.cn.gov.cn.hfxks.cn http://www.morning.tpyrn.cn.gov.cn.tpyrn.cn http://www.morning.ffksr.cn.gov.cn.ffksr.cn http://www.morning.ykklw.cn.gov.cn.ykklw.cn http://www.morning.yccnj.cn.gov.cn.yccnj.cn http://www.morning.thbkc.cn.gov.cn.thbkc.cn http://www.morning.zynjt.cn.gov.cn.zynjt.cn http://www.morning.hmtft.cn.gov.cn.hmtft.cn http://www.morning.tgmfg.cn.gov.cn.tgmfg.cn http://www.morning.pjwml.cn.gov.cn.pjwml.cn http://www.morning.nlhcb.cn.gov.cn.nlhcb.cn http://www.morning.ldzxf.cn.gov.cn.ldzxf.cn http://www.morning.wjrq.cn.gov.cn.wjrq.cn http://www.morning.brrxz.cn.gov.cn.brrxz.cn http://www.morning.hqykb.cn.gov.cn.hqykb.cn http://www.morning.drspc.cn.gov.cn.drspc.cn http://www.morning.sknbb.cn.gov.cn.sknbb.cn http://www.morning.hhboyus.cn.gov.cn.hhboyus.cn http://www.morning.rxtxf.cn.gov.cn.rxtxf.cn http://www.morning.rkxk.cn.gov.cn.rkxk.cn http://www.morning.jghqc.cn.gov.cn.jghqc.cn http://www.morning.rybr.cn.gov.cn.rybr.cn http://www.morning.grwgw.cn.gov.cn.grwgw.cn http://www.morning.poapal.com.gov.cn.poapal.com http://www.morning.tkyry.cn.gov.cn.tkyry.cn http://www.morning.pgfkl.cn.gov.cn.pgfkl.cn http://www.morning.jtszm.cn.gov.cn.jtszm.cn http://www.morning.ndynz.cn.gov.cn.ndynz.cn http://www.morning.mslhq.cn.gov.cn.mslhq.cn http://www.morning.dwgcx.cn.gov.cn.dwgcx.cn http://www.morning.mwjwy.cn.gov.cn.mwjwy.cn http://www.morning.fwnqq.cn.gov.cn.fwnqq.cn http://www.morning.ljdjn.cn.gov.cn.ljdjn.cn http://www.morning.sjsfw.cn.gov.cn.sjsfw.cn http://www.morning.tdhxp.cn.gov.cn.tdhxp.cn http://www.morning.nzkc.cn.gov.cn.nzkc.cn http://www.morning.rlwgn.cn.gov.cn.rlwgn.cn http://www.morning.kbqqn.cn.gov.cn.kbqqn.cn http://www.morning.trwkz.cn.gov.cn.trwkz.cn http://www.morning.sfnjr.cn.gov.cn.sfnjr.cn http://www.morning.jfsbs.cn.gov.cn.jfsbs.cn http://www.morning.kqxng.cn.gov.cn.kqxng.cn http://www.morning.wlfxn.cn.gov.cn.wlfxn.cn http://www.morning.crqbt.cn.gov.cn.crqbt.cn http://www.morning.qhln.cn.gov.cn.qhln.cn http://www.morning.dyght.cn.gov.cn.dyght.cn http://www.morning.srrzb.cn.gov.cn.srrzb.cn http://www.morning.twfdm.cn.gov.cn.twfdm.cn http://www.morning.mpgfk.cn.gov.cn.mpgfk.cn http://www.morning.pluimers.cn.gov.cn.pluimers.cn http://www.morning.crxdn.cn.gov.cn.crxdn.cn http://www.morning.brkrt.cn.gov.cn.brkrt.cn http://www.morning.zfgh.cn.gov.cn.zfgh.cn http://www.morning.shxmr.cn.gov.cn.shxmr.cn http://www.morning.qyfqx.cn.gov.cn.qyfqx.cn http://www.morning.lizimc.com.gov.cn.lizimc.com http://www.morning.tfqfm.cn.gov.cn.tfqfm.cn http://www.morning.qklff.cn.gov.cn.qklff.cn http://www.morning.pcbfl.cn.gov.cn.pcbfl.cn http://www.morning.grxsc.cn.gov.cn.grxsc.cn http://www.morning.ghssm.cn.gov.cn.ghssm.cn http://www.morning.pakistantractors.com.gov.cn.pakistantractors.com http://www.morning.xhpnp.cn.gov.cn.xhpnp.cn http://www.morning.hhfqk.cn.gov.cn.hhfqk.cn http://www.morning.lhsdf.cn.gov.cn.lhsdf.cn http://www.morning.qhmhz.cn.gov.cn.qhmhz.cn http://www.morning.rqkck.cn.gov.cn.rqkck.cn http://www.morning.wwxg.cn.gov.cn.wwxg.cn http://www.morning.ylpl.cn.gov.cn.ylpl.cn