Skip to content
Permalink
69c26b67fb
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
20 lines (16 sloc) 600 Bytes
import os
from os.path import join
from collections import Counter
path = os.path.dirname(os.path.realpath(__file__))
for f_name in os.listdir(path):
if f_name.startswith('artistlist.txt'):
filename = join(path, f_name)
print(filename)
top10List=filename
artistList = open(filename, "r")
artistList = artistList.read()
artistList = artistList.split(',')
print("Your Top 10 Artists are:")
for count, elem in sorted(((artistList.count(e), e) for e in set(artistList)), reverse=True):
listmode = '%s (%d)' % (elem, count) #Sorts a the list Descending
print(elem)