0

Can Python alone load images and play music?

I have been looking at some websites, but it seems that Python can't play music/sounds and load images on its own (without installing some libraries). Is that really like that? If so, what are the best libraries to do that?

31st Aug 2021, 8:22 PM
Pol C
Pol C - avatar
10 Antworten
+ 2
Thanks for the tips everyone. If I wanted to play music after I click on an image, what would be the best library then?
31st Aug 2021, 8:46 PM
Pol C
Pol C - avatar
+ 2
Pygame is made for games, or interactive GUI in general. It has sound, images, and it's pretty simple to pick up.
31st Aug 2021, 9:06 PM
Chloe
Chloe - avatar
+ 2
Alright. Now I see it everyone. Tkinter and Pygame are both good for this task, I will have a look at those libraries. Do you know any other website/docs of these libraries I could find exactly what I am looking for? I guess I can not be the first to think this. Anyway, thanks for the tips people.
31st Aug 2021, 9:10 PM
Pol C
Pol C - avatar
+ 2
Yes! Python can load image 😀 Example code: https://code.sololearn.com/caozv32tiplh/?ref=app
2nd Sep 2021, 6:41 PM
Fꫀⲅძ᥆͟ᥙ᥉᯽
Fꫀⲅძ᥆͟ᥙ᥉᯽ - avatar
+ 1
I would like to make a program that plays an audio everytime you click on a image. It would say a phrase, and then the user would input what was said on an entry box. According to what you people have told me, the best option to do this is Pygame, even though I think It is not really good with GUI?
31st Aug 2021, 9:00 PM
Pol C
Pol C - avatar
0
I believe that python can't play music on its own, but with tkinter it's possible to load images. If you need sound, pygame has a very nice sound playing system. Pygame can also load images, so pygame is a very safe choice. You can look for the pygame docs for information on how to use it :)
31st Aug 2021, 8:35 PM
Chloe
Chloe - avatar
0
To play music and load images using python built-in libraries is too hard, but you can use external packages using pip For music/audio, see: https://stackoverflow.com/questions/260738/play-audio-with-python About image processing, I recommend using pillow (PIL), see this: ('pip install pillow') https://pillow.readthedocs.io/en/stable/handbook/tutorial.html I hope this helps :)
31st Aug 2021, 8:39 PM
Sousou
Sousou - avatar
0
Click on image? What do you exactly want to make (game / app) and what library are you using for GUI?
31st Aug 2021, 8:56 PM
Sousou
Sousou - avatar
0
I prefer using tkinter for a project like that, it's simple and easy for making GUI elements, and there are many tutorials for it. Because pygame is more difficult and you have to draw everything on the screen, also pygame is recommended for game making
31st Aug 2021, 9:05 PM
Sousou
Sousou - avatar
0
You could do a search on stack overflow, or just a Google search in general. You can also look in www.pygame.org/docs
31st Aug 2021, 9:13 PM
Chloe
Chloe - avatar