{"id":96,"date":"2026-01-09T14:57:14","date_gmt":"2026-01-09T14:57:14","guid":{"rendered":"https:\/\/theroyalscode.com\/students\/d_eanes\/?p=96"},"modified":"2026-01-25T03:38:46","modified_gmt":"2026-01-25T03:38:46","slug":"free-friday-password-generator","status":"publish","type":"post","link":"https:\/\/theroyalscode.com\/students\/d_eanes\/2026\/01\/09\/free-friday-password-generator\/","title":{"rendered":"[EDIT] Free Friday 1\/9\/26"},"content":{"rendered":"\n<p>Today, I watched a video and created a simple MP3 player using Python. I learned how to load and play audio files from this video. The program runs in the terminal and lets the user select songs from a folder and control them while they play.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>   def play_music(folder, song_name):\n\n    file_path = os.path.join(folder, song_name)\n\n    if not os.path.exists(file_path):\n        print(\"File not found\")\n        return\n\n    pygame.mixer.music.load(file_path)\n    pygame.mixer.music.play()\n\n    print(f\"\\nNow playing: {song_name}\")\n    print(\"Commands: &#91;P]ause, &#91;R]esume, &#91;S]top\")\n<\/code><\/pre>\n\n\n\n<p>^This function is responsible for playing the selected MP3 file. It builds the file path, then checks if the song exists, thenloads it into the pygame mixer, and starts the song. It also displays the controls the user can use.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>while True:\n    command = input(\"&gt; \").upper()\n\n    if command == \"P\":\n        pygame.mixer.music.pause()\n        print(\"Paused\")\n    elif command == \"R\":\n        pygame.mixer.music.unpause()\n        print(\"Resumed\")\n    elif command == \"S\":\n        pygame.mixer.music.stop()\n        print(\"Stopped\")\n        return\n    else:\n        print(\"Invalid command\")<\/code><\/pre>\n\n\n\n<p>^This loop listens for user input while the music is playing. It allows the user to pause, resume, or stop the song from playing. The loop keeps running until the user decides to stop the song.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"614\" height=\"316\" src=\"https:\/\/theroyalscode.com\/students\/d_eanes\/wp-content\/uploads\/2026\/01\/Screenshot-2026-01-24-200522.png\" alt=\"\" class=\"wp-image-108\" srcset=\"https:\/\/theroyalscode.com\/students\/d_eanes\/wp-content\/uploads\/2026\/01\/Screenshot-2026-01-24-200522.png 614w, https:\/\/theroyalscode.com\/students\/d_eanes\/wp-content\/uploads\/2026\/01\/Screenshot-2026-01-24-200522-300x154.png 300w\" sizes=\"auto, (max-width: 614px) 100vw, 614px\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-video\"><\/figure>\n\n\n\n<figure class=\"wp-block-video\"><video height=\"214\" style=\"aspect-ratio: 802 \/ 214;\" width=\"802\" controls src=\"https:\/\/theroyalscode.com\/students\/d_eanes\/wp-content\/uploads\/2026\/01\/Screen-Recording-2026-01-24-204035.mp4\"><\/video><\/figure>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Today, I watched a video and created a simple MP3 player using Python. I learned how to load and play audio files from this video. The program runs in the terminal and lets the user select songs from a folder and control them while they play. ^This function is responsible for playing the selected MP3&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[],"class_list":["post-96","post","type-post","status-publish","format-standard","hentry","category-free-friday"],"_links":{"self":[{"href":"https:\/\/theroyalscode.com\/students\/d_eanes\/wp-json\/wp\/v2\/posts\/96","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/theroyalscode.com\/students\/d_eanes\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/theroyalscode.com\/students\/d_eanes\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/theroyalscode.com\/students\/d_eanes\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/theroyalscode.com\/students\/d_eanes\/wp-json\/wp\/v2\/comments?post=96"}],"version-history":[{"count":3,"href":"https:\/\/theroyalscode.com\/students\/d_eanes\/wp-json\/wp\/v2\/posts\/96\/revisions"}],"predecessor-version":[{"id":125,"href":"https:\/\/theroyalscode.com\/students\/d_eanes\/wp-json\/wp\/v2\/posts\/96\/revisions\/125"}],"wp:attachment":[{"href":"https:\/\/theroyalscode.com\/students\/d_eanes\/wp-json\/wp\/v2\/media?parent=96"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/theroyalscode.com\/students\/d_eanes\/wp-json\/wp\/v2\/categories?post=96"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/theroyalscode.com\/students\/d_eanes\/wp-json\/wp\/v2\/tags?post=96"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}