In [18]: for file in os.listdir('.'): ...: if os.path.splitext(file)[1] == '.html': ...: print(file) ...: r=shutil.copy(file,os.path.join(')) ...: print('copy path is '+r) ...: index.html copy path is Desktop\index.html3 获取扩展名和copy函数详解: In [21]: help…