Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

how to play sound after pressing a button in tkinter

from Tkinter import *
import mp3play

root = Tk() # create tkinter window

f = mp3play.load('Sound.mp3'); play = lambda: f.play()
button = Button(root, text = 'Play', command = play)

button.pack()
root.mainloop()
Comment

PREVIOUS NEXT
Code Example
Python :: bgr to gray opencv 
Python :: pandas add character to string 
Python :: pandas series to string without index 
Python :: learn python the hard way pdf 
Python :: run JupyterLab 
Python :: python generate table 
Python :: save pandas dataframe to parquet 
Python :: sort a dataframe by a column valuepython 
Python :: python install module from script 
Python :: add column as index pandas 
Python :: tkinter navigate pages 
Python :: timestamp change python 
Python :: .astype datetime 
Python :: how to sum digits of a number in python 
Python :: base64 decode python 
Python :: seaborn hue order 
Python :: plt plot circle 
Python :: add horizontal line plotly 
Python :: How to find least common multiple of two numbers in Python 
Python :: python count repeated elements in a list 
Python :: dataframe to txt 
Python :: python numpy array check if all nans 
Python :: pandas convert column to index 
Python :: button images in tkinter 
Python :: E: Unable to locate package python3-pip docker file 
Python :: insta profile downloader in python 
Python :: how to unzip files using zipfile module python 
Python :: python requests.get pdf An appropriate representation of the requested resource could not be found 
Python :: pyqt5 wait cursor 
Python :: how to check suffix in python 
ADD CONTENT
Topic
Content
Source link
Name
2+6 =