Skip to content

Commit b5f2fb3

Browse files
Python Tkinter Build an MP3 player Update 4
1 parent d7fe3d1 commit b5f2fb3

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

Python TKinter Build An MP3 Player/buildAnMP3Player.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
root = Tk()
99

10-
root.title("MP3 Player")
10+
root.title("Reproductor MP3")
1111
root.geometry("500x400")
1212

1313
# Initialize Pygame
@@ -27,7 +27,7 @@ def play_time():
2727

2828
# Reconstruct song with directory structure stuff
2929
song = playlist_box.get(ACTIVE)
30-
song = f'Python TKinter Build An MP3 Player/audio/{song}.mp3'
30+
song = f'C:/mp3/audio/{song}.mp3'
3131

3232
# Find Current Song Length
3333
song_mut = MP3(song)
@@ -80,7 +80,7 @@ def add_many_songs():
8080
# Loop thru song list and replace directory structure and mp3 from song name
8181
for song in songs:
8282
# Strip out directory structure and .mp3 from song title
83-
song = song.replace("C:/mp3/audio/", "")
83+
song = song.replace("c", "")
8484
song = song.replace(".mp3", "")
8585
# Add To End of Playlist
8686
playlist_box.insert(END, song)
@@ -103,8 +103,7 @@ def play():
103103

104104
# Reconstruct song with directory structure stuff
105105
song = playlist_box.get(ACTIVE)
106-
song = f'Python TKinter Build An MP3 Player/audio/{song}.mp3'
107-
106+
song = f'C:/mp3/audio/{song}.mp3'
108107
#Load song with pygame mixer
109108
pygame.mixer.music.load(song)
110109
#Play song with pygame mixer

0 commit comments

Comments
 (0)