generate functionWed, 15 Feb 2023

создания плейлиста m3u со вложенных файлов в папке linux

#!/usr/bin/env python3 import os import sys from os import listdir from os.path import isdir, isfile, join from os import walk from re import search #print("sys.argv[0] =", sys.argv[0]) #print("sys.argv[1] =", sys.argv[1]) path = sys.argv[1] def get_files(path): files = [f for f in listdir(path) if isfile(join(path, f)) and (search('mp3', f, flags=0) or search('m4a', f, flags=0) or search('wav', f, flags=0))] for file in files: print(file) def print_playlist(): print("#EXTM3U") for (path, dirs, files) in walk(sys.argv[1]): for file in files: if (search('mp3', file, flags=0) or search('m4

Questions about programming?Chat with your personal AI assistant