31 thoughts on “Music Player in Python – Part 1

  1. tip: if you want to get the home directory, you can use
    home = os.path.expanduser(“~”)
    this works on most platforms, particularly windows and linux

  2. Tip: if you like the filename and the file extension, you should use
    from os.path import splitext
    filename, file_ext = splitext(file_path)
    splitext splits the file path into the name of the file and its extension.

  3. Hi Vineeth, thank you for this awesome tutorial. Can you tell me how to access other mp3 metadata? I can't seem to figure it out from the Mutagen docs. I'm trying to build a list of all of my songs, sorted by Date Modified (oldest to newest), and then use that list to build a playlist of a specific length (so I would also need access to the file Length).

Leave a Reply

Your email address will not be published. Required fields are marked *