gpt4 book ai didi

python - 在 Python 中自动创建列表

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

<分区>

我的代码:

red_images =  'DDtest/210red.png'
green_images = 'DDtest/183green.png'

b = [red_images, green_images]
shuffle(b)

我有几百张图片,希望让我的代码尽可能简洁(并扩展我的 python 知识),我想知道如何编写代码来自动获取文件夹中的文件并将它们制成列表。

我在 R 中做过类似的事情,但我不确定如何在 python 中做。

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