Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
Aashishkumar123 authored Sep 19, 2020
1 parent 6345e37 commit cca0427
Show file tree
Hide file tree
Showing 25 changed files with 32 additions and 0 deletions.
Binary file added Piano Application/Piano1.mp3
Binary file not shown.
Binary file added Piano Application/Piano10.mp3
Binary file not shown.
Binary file added Piano Application/Piano11.mp3
Binary file not shown.
Binary file added Piano Application/Piano12.mp3
Binary file not shown.
Binary file added Piano Application/Piano13.mp3
Binary file not shown.
Binary file added Piano Application/Piano14.mp3
Binary file not shown.
Binary file added Piano Application/Piano15.mp3
Binary file not shown.
Binary file added Piano Application/Piano16.mp3
Binary file not shown.
Binary file added Piano Application/Piano17.mp3
Binary file not shown.
Binary file added Piano Application/Piano18.mp3
Binary file not shown.
Binary file added Piano Application/Piano19.mp3
Binary file not shown.
Binary file added Piano Application/Piano2.mp3
Binary file not shown.
Binary file added Piano Application/Piano20.mp3
Binary file not shown.
Binary file added Piano Application/Piano21.mp3
Binary file not shown.
Binary file added Piano Application/Piano22.mp3
Binary file not shown.
Binary file added Piano Application/Piano23.mp3
Binary file not shown.
Binary file added Piano Application/Piano3.mp3
Binary file not shown.
Binary file added Piano Application/Piano4.mp3
Binary file not shown.
Binary file added Piano Application/Piano5.mp3
Binary file not shown.
Binary file added Piano Application/Piano6.mp3
Binary file not shown.
Binary file added Piano Application/Piano7.mp3
Binary file not shown.
Binary file added Piano Application/Piano8.mp3
Binary file not shown.
Binary file added Piano Application/Piano9.mp3
Binary file not shown.
Binary file added Piano Application/piano.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
32 changes: 32 additions & 0 deletions Piano Application/piano.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
from tkinter import *
import tkinter as tk
from PIL import ImageTk, Image
from playsound import playsound
root = tk.Tk()
root.geometry('700x300')
root.title("piano")
root.maxsize(700,300)
root.minsize(700,300)
root['bg']="white"
icon = ImageTk.PhotoImage(Image.open('piano.png'))
icon_label = Label(root,image=icon)
icon_label.place(x=295,y=10)
frame1 = Frame(root,width=700,height=198,bg="white")
frame1.place(x=0,y=100)
class piano():
def PianoSound(self,sound):
playsound(f'Piano{sound}.mp3')
def __init__(self,index):
self.index = index
if self.index%2 != 0:
Button(frame1,padx=10,pady=100,bg="black",fg="white",relief=RAISED,borderwidth=3,command=lambda:self.PianoSound(self.index),cursor="hand2").grid(row=0,column=self.index)
else:
Button(frame1,padx=10,pady=100,bg="white",fg="black",relief=RAISED,borderwidth=2,command=lambda:self.PianoSound(self.index),cursor="hand2").grid(row=0,column=self.index)
if __name__ == '__main__':
for i in range(1,24):
piano(i)
root.mainloop()




0 comments on commit cca0427

Please sign in to comment.