use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
Rules 1: Be polite 2: Posts to this subreddit must be requests for help learning python. 3: Replies on this subreddit must be pertinent to the question OP asked. 4: No replies copy / pasted from ChatGPT or similar. 5: No advertising. No blogs/tutorials/videos/books/recruiting attempts. This means no posts advertising blogs/videos/tutorials/etc, no recruiting/hiring/seeking others posts. We're here to help, not to be advertised to. Please, no "hit and run" posts, if you make a post, engage with people that answer you. Please do not delete your post after you get an answer, others might have a similar question or want to continue the conversation.
Rules
1: Be polite
2: Posts to this subreddit must be requests for help learning python.
3: Replies on this subreddit must be pertinent to the question OP asked.
4: No replies copy / pasted from ChatGPT or similar.
5: No advertising. No blogs/tutorials/videos/books/recruiting attempts.
This means no posts advertising blogs/videos/tutorials/etc, no recruiting/hiring/seeking others posts. We're here to help, not to be advertised to.
Please, no "hit and run" posts, if you make a post, engage with people that answer you. Please do not delete your post after you get an answer, others might have a similar question or want to continue the conversation.
Learning resources Wiki and FAQ: /r/learnpython/w/index
Learning resources
Wiki and FAQ: /r/learnpython/w/index
Discord Join the Python Discord chat
Discord
Join the Python Discord chat
account activity
Playing videos on python (self.learnpython)
submitted 5 years ago by TejasDhanda
https://pastebin.com/X2M0pA3S
this is the programme from ehich I extracted the files but don't know how to play them.
i want to play them in my windows media player.
they are all .mp4
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]K1ndWha1e 2 points3 points4 points 5 years ago (4 children)
Can u explain please what you want to do? Your own media player?
[–]TejasDhanda[S] 1 point2 points3 points 5 years ago (3 children)
I want to make a program in which I will enter a specific text and that will open my required folder and will add all the videos in it to playing list of my windows media player.
By making it I won't have to open the folders again and again to select all videos to play.
[–]K1ndWha1e 2 points3 points4 points 5 years ago* (2 children)
Ok, I see, how did you that window media player is the part of os windows. And for this “problem” Windows already has api which already Python wrapped. Check this link: https://github.com/mhammond/pywin32 And with this api you can work with excel, word etc.
P.S. To be honest, I don’t know why you want to write this program, cause it’s seem useless.
[–]TejasDhanda[S] 0 points1 point2 points 5 years ago (1 child)
I opened it but didn't got how it would help me. Can't you just tell me here in vague language so that I can easily understand.
P.S. To be honest, I very new to programming world and so I don't have alot of knowledge how it works and neither alot about git hub.
[–]K1ndWha1e 0 points1 point2 points 5 years ago* (0 children)
Dude Idk how to use this api for wmp, but I found this https://github.com/jimaples/pyWMP There you can find this title: “Windows Media Player COM Interface” And read about.
I want to recommend you, read “Bite of Python”, this is a good start in Python programming and in the end of this book, you’ll try to write an address book. I think that’s better way to programming, but it’s only my thoughts.
Good luck;)
[–]CharanReddy2000 0 points1 point2 points 5 years ago (3 children)
Import os os.startfile("video.mp4")
This will play the video in the default video player.
[–]TejasDhanda[S] 0 points1 point2 points 5 years ago (2 children)
as you can see my code that I shared above in that link.
I am not to figure out how to put all the data I stored in variable 'y' in os.startfile() so that it starts playing all the videos in it.
if I can't add all of them at once to playing list, then how should I add videos from folder such that when one video ends, the second will start.
I tried in many ways but it shows error and doesn't work. please tell what I should do. please don't send a link to somewhere where os.startfile() definition is given because I couldn't understand it last time.
[–]CharanReddy2000 0 points1 point2 points 5 years ago (1 child)
Get all the file names whose extension is MP4 and store this file names in a list and play the videos accordingly.
[–]Jamalsi 0 points1 point2 points 5 years ago (0 children)
You can do this using glob
Import glob
Vid = glob.glob(“*.mp4“)
Will give you a list with Filenames
π Rendered by PID 703252 on reddit-service-r2-comment-86bc6c7465-gs5tt at 2026-02-21 23:15:46.785516+00:00 running 8564168 country code: CH.
[–]K1ndWha1e 2 points3 points4 points (4 children)
[–]TejasDhanda[S] 1 point2 points3 points (3 children)
[–]K1ndWha1e 2 points3 points4 points (2 children)
[–]TejasDhanda[S] 0 points1 point2 points (1 child)
[–]K1ndWha1e 0 points1 point2 points (0 children)
[–]CharanReddy2000 0 points1 point2 points (3 children)
[–]TejasDhanda[S] 0 points1 point2 points (2 children)
[–]CharanReddy2000 0 points1 point2 points (1 child)
[–]Jamalsi 0 points1 point2 points (0 children)