【发布时间】:2015-08-06 12:22:42
【问题描述】:
我在不同的位置有两个文件:/tmp/helpers_image.tif 和 /tmp/outputs/helpers_image.qml。我想在扩展之前比较他们的名字。
如何比较这两个文件夹中的文件?
如果这些文件在同一个文件夹中,我可以使用:
t1 = 'helpers_image.qml'
t1_list= t1.split('.')
t1_list[0] == t2_list[0]
...假设另一个列表将被称为t2。
【问题讨论】: