欧美一区二区三区老妇人-欧美做爰猛烈大尺度电-99久久夜色精品国产亚洲a-亚洲福利视频一区二区

python實(shí)現(xiàn)批量檢查兩個(gè)對(duì)應(yīng)的txt文件的行數(shù)是否一致-創(chuàng)新互聯(lián)

python實(shí)現(xiàn)批量檢查兩個(gè)對(duì)應(yīng)的txt文件的行數(shù)是否一致?相信很多沒有經(jīng)驗(yàn)的人對(duì)此束手無(wú)策,為此本文總結(jié)了問題出現(xiàn)的原因和解決方法,通過這篇文章希望你能解決這個(gè)問題。

成都創(chuàng)新互聯(lián)是專業(yè)的尼瀘西網(wǎng)站建設(shè)公司,尼瀘西接單;提供網(wǎng)站建設(shè)、網(wǎng)站設(shè)計(jì),網(wǎng)頁(yè)設(shè)計(jì),網(wǎng)站設(shè)計(jì),建網(wǎng)站,PHP網(wǎng)站建設(shè)等專業(yè)做網(wǎng)站服務(wù);采用PHP框架,可快速的進(jìn)行尼瀘西網(wǎng)站開發(fā)網(wǎng)頁(yè)制作和功能擴(kuò)展;專業(yè)做搜索引擎喜愛的網(wǎng)站,專業(yè)的做網(wǎng)站團(tuán)隊(duì),希望更多企業(yè)前來(lái)合作!

代碼如下


#coding=utf-8
import os, glob
import numpy as np

path2 = 'temp//1//'
path3 = 'temp//2//'

file_one_list = glob.glob(path2 + "*.txt")
file_two_list = glob.glob(path3 + "*.txt")
print(len(file_one_list))

for item in (file_one_list):
 base_name = os.path.basename(item)
 with open(item,'r') as f:
  lines_one=f.readlines()
 cur_file_path = os.path.join(path3, base_name)
 if os.path.exists(cur_file_path):
  with open(cur_file_path,'r') as f:
   lines_two=f.readlines()
  if len(lines_one)!=len(lines_two):
   print("檢測(cè)框不對(duì)應(yīng):",base_name)
 else:
  print("不在在文件",base_name)

分享標(biāo)題:python實(shí)現(xiàn)批量檢查兩個(gè)對(duì)應(yīng)的txt文件的行數(shù)是否一致-創(chuàng)新互聯(lián)
文章位置:http://chinadenli.net/article18/cdpegp.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供面包屑導(dǎo)航、企業(yè)網(wǎng)站制作、外貿(mào)建站、搜索引擎優(yōu)化、商城網(wǎng)站、用戶體驗(yàn)

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如需處理請(qǐng)聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來(lái)源: 創(chuàng)新互聯(lián)

網(wǎng)站優(yōu)化排名