需要知道12行 Python 单行代码2
import os all_files = [os.path.join(dp, f) for dp, dn, filenames in os.walk('/path/to/dir') for f in filenames]
import os all_files = [os.path.join(dp, f) for dp, dn, filenames in os.walk('/path/to/dir') for f in filenames]
l1 = [1, 2, 3]l2 = [2, 3, 4]list(set(l1) & set(l2))list(set(l1).intersection(set(l2)))// [2,3]