gpt4 book ai didi

python - 或者条件 Python

转载 作者:太空宇宙 更新时间:2023-11-04 10:12:39 25 4
gpt4 key购买 nike

<分区>

有没有办法让某种类型的文件扩展名类型而不是所有冗余的 OR 条件?

for file in os.listdir(source_directory):
if file.endswith(".xlsx") or file.endswith(".xls") or file.endswith(".xlsm") or file.endswith(".xlsb"):

类似的东西

if file.endswith(".xlsx","xls","xlsm","xlsb"):

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com