def auto_complete_prompt(allowed_extensions, file_type):
os_walk = os.walk(".")
all_files = []
for cur_dir, child_dirs, files in os_walk:
if cur_dir == ".":
for file in files:
file_name, extension = os.path.splitext(file)
if (extension in allowed_extensions):
all_files.append(file)
break
auto_complete_files = WordCompleter(all_files, ignore_case=True)
video_file_name = prompt(
"Which {0} file you like to trim: ".format(file_type),
completer=auto_complete_files,
complete_while_typing=True)
return video_file_name
评论列表
文章目录