$(function(){
var tb = $("table.gradeTabel")
var txt = $(":text")
$(":button[value='添加']").click(function(){
var v = $.trim(txt.val())
if(v=="") return
else if(!/^\d+$/.test(v)){
alert("要输入数字才对")
txt.focus()
txt.select()
return
}
else if(tb.find("tr:contains('"+v+"')").length != 0){
alert("学号已经存在了!")
return
}
tb.append("<tr><td colspan=1 class='stu_Number'>"+v+"</td></tr>")
})
})
</script>
import pandas as pdimport os
# 用os.walk遍历文件;用.endswith判断文件后缀
dfs = pd.DataFrame()
for root, dirs, files in os.walk(r'C:\Users\ll\Desktop\pandas\excels'):
for file in files:
if file.endswith('.xlsx'):
# 构建绝对路径
file_name = os.path.join(root, file)
# print(file_name)
df = pd.read_excel(file_name)
# print(df)
dfs = pd.concat([dfs, df])
# print(dfs)
dfs.to_excel(r'C:\Users\ll\Desktop\new.xlsx')
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)