【发布时间】:2019-08-11 15:13:59
【问题描述】:
我在 Python3 中有一个像这样的图像数组...
images = [
"/var/www/html/myfolder/images/1.jpg",
"/var/www/html/myfolder/images/441.jpg",
"/var/www/html/myfolder/images/15.jpg",
"/var/www/html/myfolder/images/78.jpg",
]
我不想像这样指定图像,而是想传递一个绝对路径并让 python 从该路径中的 .jpg 图像中创建图像列表。
我最好的方法是什么?
【问题讨论】:
-
我的脚本中已经将路径保存为
path,但实际上是在扫描文件夹以获取 jpg 文件
标签: python python-3.x