Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7411091
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T06:20:00+00:00 2026-05-29T06:20:00+00:00

Is it possible to play all the .mp3’s within a folder in windows media

  • 0

Is it possible to play all the .mp3’s within a folder in windows media player?

I am using Python 3.2, and so far I have code that returns the absolute location of a random album in my music folder.
I would like to take that string and somehow open WMP and play the music within that folder

Any suggestions?

For reference, here is my code:

import random
import os

path = ["Q:\\#User\\Music\\", "Q:\\#user\\What CDs\\"]
print("You shall play " + random.sample(list(filter(lambda f: len([i for i in f if i in "."]) == 0, sum(map(lambda d: list(map(lambda e: d + "\\" + e,os.listdir(d))),list(filter(lambda c: len([i for i in c if i in "."]) == 0, sum(map(lambda a: list(map(lambda b: a + b ,os.listdir(a))), path), [])))), []) )), 1)[0])


input()

And yes, ideally that wouldn’t all be in one line. I was learning how to use map and lambda and thought I’d challenge myself.
I’d now like to take this one step further, and play the random album.

Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T06:20:01+00:00Added an answer on May 29, 2026 at 6:20 am

    Hmmmm, interesting idea.

    I would probably create a .m3u file on the fly and then pass it to WMP as a command line argument (which, according to WMP Command Line is certainly doable).

    A .m3u file is simply a text file. Here is an example .m3u for the Tool album Undertow:

    #EXTM3U
    #EXTINF:295,Tool - Intolerance
    01 - Intolerance.mp3
    #EXTINF:296,Tool - Prison Sex
    02 - Prison Sex.mp3
    #EXTINF:307,Tool - Sober
    03 - Sober.mp3
    #EXTINF:434,Tool - Bottom
    04 - Bottom.mp3
    #EXTINF:330,Tool - Crawl Away
    05 - Crawl Away.mp3
    #EXTINF:332,Tool - Swamp Song
    06 - Swamp Song.mp3
    #EXTINF:322,Tool - Undertow
    07 - Undertow.mp3
    #EXTINF:363,Tool - 4°
    08 - 4°.mp3
    #EXTINF:466,Tool - Flood
    09 - Flood.mp3
    #EXTINF:947,Tool - Disgustipated
    69 - Disgustipated.mp3
    

    Good luck!

    PS – You can invoke the command line argument by importing the os module and using os.system("YOUR DOS COMMAND")

    Oh, and the format used in an m3u file:

    #EXTINF:<song-time-in-seconds>, <Artist> - <Song>
    <Track_Num> - <File name>
    

    If it wasn’t clear.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Possible Duplicate: Learning Python: If condition executing all the time This Python code is
I am using Google's Audio player to play an MP3 on a webpage. My
In my democode an embeded windows media player starts to load and play a
Is it possible to play movie again and again using the MPMoviePlayerController class? Thanks
Using the Android SDK, is it possible to play a video stream using the
How would it be possible to have a HTML page play a flash animation
I have a problem with persisting data via play-framework. Maybe it's not possible to
I produce server software and have been fine with all Linux environments so far,
I have the following Play Framework entity (using Morphia for persistence) as part of
Possible Duplicate: How to play mp3 file in c++? Hi, I am doing a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.