▶️ Watch Entire Tkinter Playlist ✅ Subscribe To My RUclips Channel: bit.ly/2UFLKgj bit.ly/2IGzvOR ▶️ See More At: ✅ Join My Facebook Group: Codemy.com bit.ly/2GFmOBz ▶️ Learn to Code at Codemy.com ✅ Buy a Codemy T-Shirt! Take $30 off with coupon code: youtube1 bit.ly/2VC9WUN ▶️ Get The Code bit.ly/3fLFQ8p
I already added those buttons this morning... And i also added a progress bar which indicates the duration of the current playing song but i failed to add scrolling system with the progressing bar #Lol you are a true teacher #lots of love from india
Tell me something. Imagine the selected song is the one at the end of the listbox. When i press the next button I want the first song in the song to be selected. How do I do that?
If i select many songs then i want that after one song finished play then automaticly must go to the next song and play and so on. How to code that? Please need your help!!
Hello John, I'm sorry that my question is not specifically related to the topic of your video, i was just trying to reach you I'm wondering if it's possible to keep on using the default sqlite3 database rather than postgresql/mongoDb/mysql with django project (My senior project) My project is kind of E-commerce application with functionality to the user to register/login/add to cart/view cart items/checkout etc.. Admin can CRUD products and customers from the admin home page all i want is to perform certain actions on product or customer from my admin home page and see it directly saved and refreshed in the table in db Browser for sqlite And in general can sqlite3 make the same actions as postgresql/ Mongodb...
Sure, it just depends on the web host (some won't let you use sqlite3 because it's not suited for heavy use). Though, the beauty of using a web framework like Django is that you can swap out any database without needing to change the database code at all. Just change your settings.py file to designate whatever database you want to use. Your app code (your models.py file for instance) doesn't change at all. So it's sort of irrelevant...
when I run the project I get this error: next_one = next_one[x] + 1 IndexError: tuple index out of range and I do everything good I copy your code and its steal doing this I use pycharm you can help me?
seriously bro, please and please i'll seriously need the ebook for this tkinter and cant wait for you to write that book.This just so much to grab at ones... Thanks a lot for all the videos
Hi John, my curselection() didnt print tuple as yours like (0, ) or (1, 0). my ide print out is () () () next_one = next_one[0]+1 IndexError: tuple index out of range
If i hit the fwd button, the selection does go ahead one... but every time after that, the fwd button just restarts the current song. Also, getting 'tuple out of range'.
Hello bro, I have a problem File "D"\Developer\Test\1.py, line 68, in previous_song song = f' D:/Developer/Complete/Song/{song}.mp3' UnboundLocalError: local variable 'song' referenced before assignment my line 68 : song = f'D:/Developer/Complete/Song/{song}.mp3'
@@ekitran Your code is not the same as the video. The structure is wrong. Your variable is being called in the program before you have defined it in the program.
I found 1 exception while clicking forward or back button. If it is the end of list or beginning of the list we cannot go forward or back becuase the index of the list becuase not accessible! Hopefully the following code might fix you the error if you too got the same. #In def next_song(): #Before song = song_box.get(next_one) Size = song_box.size() If next_one == size: Next_one = next_one - size #In previous_song(): Size=song_box.size() If next_one == -1 Next_one = next_one + size
▶️ Watch Entire Tkinter Playlist ✅ Subscribe To My RUclips Channel:
bit.ly/2UFLKgj bit.ly/2IGzvOR
▶️ See More At: ✅ Join My Facebook Group:
Codemy.com bit.ly/2GFmOBz
▶️ Learn to Code at Codemy.com ✅ Buy a Codemy T-Shirt!
Take $30 off with coupon code: youtube1 bit.ly/2VC9WUN
▶️ Get The Code
bit.ly/3fLFQ8p
I already added those buttons this morning...
And i also added a progress bar which indicates the duration of the current playing song but i failed to add scrolling system with the progressing bar
#Lol you are a true teacher
#lots of love from india
Fun
Its crazy how these tutorials are amazing
Glad you think so!
from tkinter import *
from pygame import mixer
import os
from tkinter.filedialog import askopenfile
def backsong():
songstatus.set('back')
mixer.music.back()
def playsong():
currentsong = songList.get(ACTIVE)
print(currentsong)
mixer.music.load(currentsong)
songstatus.set('Playing')
mixer.music.play()
def stopsong():
songstatus.set('Stopped')
mixer.music.stop()
#create global pause
global paused
paused = False
def pausesong(is_paused):
global paused
paused = (is_paused)
if paused:
mixer.music.unpause()
paused = False
else:
mixer.music.pause()
paused = True
def nextsong():
nextone = songList.curselection()
nextone = nextone[0]+1
song = songList.get(nextone)
mixer.music.load(song)
mixer.music.play()
def open_file():
songs = askopenfile(initialdir='C://', mode ='r', filetypes =[('mp3 files', '*.mp3')], title='Please select a')
#add song to list box
songList.insert(END,songs)
window = Tk()
# main window geometry
window.geometry('450x300')
# main window title
window.title('O MUSIC PLAYER')
window.resizable(TRUE,TRUE)
mixer.init()
songstatus=StringVar()
songstatus.set('Choosing')
#create a listbox of songs to select from
songList=Listbox(window, width =35)
songList.grid(row=0,column=0,padx=10)
#scroll = Scrollbar(songList)
#scroll.pack(side=RIGHT, fill=Y)
#scroll.config( command = songList.yview )
os.chdir(r'C:\\Users\\OLIS\\Music\\Burna Boy - Twice As Tall - (SongsLover.com)')
songs=os.listdir()
for song in songs:
if song.endswith('.mp3'):
songList.insert(END,song)
#create music player images button
backBtn_img=PhotoImage(file='C:\\Users\\OLIS\\Desktop\\HELLO CODE\Music Player\\151845-music-player-icons\\png\\back.png')
playBtn_img=PhotoImage(file='C:\\Users\\OLIS\\Desktop\\HELLO CODE\\Music Player\\151845-music-player-icons\\png\\play.png')
pauseBtn_img=PhotoImage(file='C:\\Users\\OLIS\Desktop\\HELLO CODE\\Music Player\\151845-music-player-icons\\png\\pause.png')
stopBtn_img=PhotoImage(file='C:\\Users\\OLIS\\Desktop\\HELLO CODE\\Music Player\\151845-music-player-icons\\png\\stop.png')
nextBtn_img=PhotoImage(file='C:\\Users\\OLIS\\Desktop\\HELLO CODE\\Music Player\\151845-music-player-icons\\png\
ext.png')
#create track frame
trackFrame = Frame(window)
trackFrame.grid(row=0,column=1, sticky=S, padx=10)
#create control buttons
backBtn = Button(trackFrame, image=backBtn_img, borderwidth=0, command=backsong)
playBtn = Button(trackFrame, image=playBtn_img, borderwidth=0, command=playsong)
pauseBtn = Button(trackFrame, image=pauseBtn_img,borderwidth=0, command= lambda:pausesong(paused))
stopBtn = Button(trackFrame, image=stopBtn_img, borderwidth=0, command=stopsong)
nextBtn = Button(trackFrame, image=nextBtn_img, borderwidth=0, command=nextsong)
playBtn.grid(row=0, column=2,padx=5)
pauseBtn.grid(row=0, column=1,padx=5)
stopBtn.grid(row=0, column=3,padx=5)
nextBtn.grid(row=0, column=4,padx=5)
backBtn.grid(row=0, column=0,padx=5)
addfile=Label(window,text='Select music from folder :')
addfile.grid(row=1,column=0,padx=10,sticky=W)
#add file control
addfileBtn_img = PhotoImage(file='C:\\Users\\OLIS\\Desktop\\HELLO CODE\Music Player\\151845-music-player-icons\\png\\addfile.png')
#create add file button
addfileBtn = Button(window, image=addfileBtn_img, borderwidth=0, command = lambda:open_file())
#addfile to window
addfileBtn.grid(row=2,column=0,padx=10,sticky=W)
window.mainloop()
ive made several mistakes and i don't know where to start
@@olisfortune6326 Do you want to see my code ?
Best Tkinter playlist!
Thanks!
Tell me something. Imagine the selected song is the one at the end of the listbox. When i press the next button I want the first song in the song to be selected. How do I do that?
when I run the project I get this error: next_one = next_one[x] + 1
IndexError: tuple index out of range can you help me out with this error?
Msny thanks for your inspiring work!
Glad you're enjoying it!
If i select many songs then i want that after one song finished play then automaticly must go to the next song and play and so on.
How to code that?
Please need your help!!
Hello John,
I'm sorry that my question is not specifically related to the topic of your video, i was just trying to reach you
I'm wondering if it's possible to keep on using the default sqlite3 database rather than postgresql/mongoDb/mysql with django project (My senior project)
My project is kind of E-commerce application with functionality to the user to register/login/add to cart/view cart items/checkout etc..
Admin can CRUD products and customers from the admin home page
all i want is to perform certain actions on product or customer from my admin home page and see it directly saved and refreshed in the table in db Browser for sqlite
And in general can sqlite3 make the same actions as postgresql/ Mongodb...
Sure, it just depends on the web host (some won't let you use sqlite3 because it's not suited for heavy use). Though, the beauty of using a web framework like Django is that you can swap out any database without needing to change the database code at all. Just change your settings.py file to designate whatever database you want to use. Your app code (your models.py file for instance) doesn't change at all. So it's sort of irrelevant...
@@Codemycom So helpful Thank you Sir I appreciate your time ❤
Smash the Like button python fans! Doesn't cost you a thing. Great Python tkinter tutorial! cheers!
Thanks!
when I run the project I get this error: next_one = next_one[x] + 1
IndexError: tuple index out of range
and I do everything good I copy your code and its steal doing this I use pycharm you can help me?
Sorry, I never use pycharm
because you didn't choose item in list box. Put this code to add_song and add_many_song function and it will be fine
song_box.select_set(0)
@@_toilatung Thanks
seriously bro, please and please i'll seriously need the ebook for this tkinter and cant wait for you to write that book.This just so much to grab at ones... Thanks a lot for all the videos
Will be writing it :-)
song is frist one when I clicked the backward but the song is not restart ..still continue.. could u please explain sir....
Check your code for typos
Wonderful tutorial :)
Thanks!
Hi John,
my curselection() didnt print tuple as yours like (0, ) or (1, 0).
my ide print out is
()
()
()
next_one = next_one[0]+1
IndexError: tuple index out of range
what ide?
because you didn't choose item in list box. Put this code to add_song and add_many_song function and it will be fine
song_box.select_set(0)
If i hit the fwd button, the selection does go ahead one... but every time after that, the fwd button just restarts the current song. Also, getting 'tuple out of range'.
Damn.... had this...song_box.selection_set(next_one, last=None).... with "_____" around None..... excuse me while I slap myself.
Hello bro, I have a problem
File "D"\Developer\Test\1.py, line 68, in previous_song
song = f' D:/Developer/Complete/Song/{song}.mp3'
UnboundLocalError: local variable 'song' referenced before assignment
my line 68 : song = f'D:/Developer/Complete/Song/{song}.mp3'
your song variable is being referenced before it gets assigned..
@@Codemycom Can you say clearer
@@ekitran Your code is not the same as the video. The structure is wrong. Your variable is being called in the program before you have defined it in the program.
@@Codemycom Oh my code has a problem.Sorry to bother you, thank you very much.
I found 1 exception while clicking forward or back button. If it is the end of list or beginning of the list we cannot go forward or back becuase the index of the list becuase not accessible!
Hopefully the following code might fix you the error if you too got the same.
#In def next_song():
#Before song = song_box.get(next_one)
Size = song_box.size()
If next_one == size:
Next_one = next_one - size
#In previous_song():
Size=song_box.size()
If next_one == -1
Next_one = next_one + size
Hey if i sign up for a course on codemy will i get a certificate for it ?
Yeah you get a certificate with course completion.
Thanks
Welcome
I keep getting this error whenever i try to execute the program
_tkinter.TclError: unknown option "-lable"
Please Help
You've misspelled label as lable somewhere
@@Codemycom oh thankyou
'tuple' object is not callable [0] +1... I need help please
check your code for typos
like the image on the buttons, im nicking that idea :)
That's what it's there for ;-)
@@Codemycom XD
I have a problem with forwarding button i write the code as you write it but its not working
You likely have a typo
@@Codemycom pygame.mixer.music.load(sound)
NameError: name 'sound' is not defined this is my eror
@@MedTech1 it’s telling you that you haven’t set the variable named sound.
@@Codemycom oh ya thanks just i write sond not sound sorry
great can you do the same with pls files or both with mp3. thanks.
I don’t know what pls files are
thank you
You're welcome
😳 ooooh my GOD, amazing
ha, thanks!
lesson is very good. it's just that I'm an asshole