```python
import os
f = open(os.curdir+os.sep+'vedioList.txt','w')#创建文件
def file_move(path,target):#复杂的参数数据可以通过参数传递
os.chdir(path)
all_file = os.listdir(os.curdir)
for each in all_file:
extension = os.path.splitext(each)[1]
if extension in target:
f.write(os.getcwd()+os.sep+each+os.linesep)#返回对应的文件
else:
pass #pass 不做任何事情,一般用做占位语句。
if os.path.isdir(each):
file_move(each,target)
os.chdir(os.pardir)
path = input('请输入路径:')
target=['.mp4','.avi','.rmvb','.mkv']
file_move(path,target)
f.close()