Skip to content

Instantly share code, notes, and snippets.

Last active March 12, 2021 08:31
What would you like to do?
import os
import shutil
listing = os.listdir()
filtered = []
for item in listing:
if ".mp3" in item:
tempdata = item.split(".mp3") # Can use any other file than .mp3
requireditem = tempdata[0]
with open("current.txt", "w") as file:
for i in filtered:
file.write(i + "\n")
shutil.copy("current.txt", "..\\Shared") # This is just for me as I wanted to copy the file somewhere.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment