Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

play music with time in python

from tkinter import*
import pyglet

root = Tk()

player = pyglet.media.Player()
song = "er.mp3"
src = pyglet.media.load(song)
player.queue(src)

def play():
    player.play()

def pause():
    player.pause()

button_1 = Button(root,text = "Play", command = play)
button_1.pack()
button_2 = Button(root,text = "Pause", command = pause)
button_2.pack()

root.mainloop()
Comment

python play music

import sys
import subprocess
subprocess.check_call([sys.executable, '-m', 'pip', 'install',
'playsound'])
import playsound
playsound("MyPathMySound.mp3")
Comment

PREVIOUS NEXT
Code Example
Python :: handler.setLevel(logging.DEBUG) not working python 
Python :: how to read files in python 
Python :: python enumerate start at 1 
Python :: set jupyer color to dark 
Python :: median absolute deviation scipy 
Python :: Tkinter canvas draggable 
Python :: python enumerate() function 
Python :: print 2d array in python 
Python :: how to upload file in python tkinter 
Python :: is prime in python 
Python :: download image python from url 
Python :: decode html python 
Python :: kneighbours regressor sklearn 
Python :: how to convert string to byte without encoding python 
Python :: python df select first x columns 
Python :: no migrations to apply django 
Python :: and condition with or in django 
Python :: how to rename columns in python 
Python :: python unzip list 
Python :: python delete file with extension 
Python :: The operands of the logical operators should be boolean expressions, but Python is not very strict. Any nonzero number is interpreted as True. 
Python :: how to playsound in python 
Python :: numpy apply function to array 
Python :: sort list in python by substring 
Python :: python get current month 
Python :: invert a dictionary python 
Python :: star pattern in python 
Python :: webbrowser.google.open python 
Python :: python print in one line 
Python :: parquet to dataframe 
ADD CONTENT
Topic
Content
Source link
Name
2+2 =