Python Forum
what am i doing wrong!? music wont play
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
what am i doing wrong!? music wont play
#2
for proot you are using os.getcwd()

do you want the folder of the script as proot ?

try that and see if the results are different

import os
import sys

proot = os.getcwd()
proot2 = os.path.dirname(sys.argv[0])
print(proot)
print(proot2)
Quote:music = os.path.join(os.environ["HOME"], "Music")

gives

Output:
/home/username/Music
if you use localized folder names (in Linux) it will not work

I use in Linux to get localized user folders

from gi.repository import GLib

music = GLib.get_user_special_dir(GLib.USER_DIRECTORY_MUSIC)
print(music)
Reply


Messages In This Thread
RE: what am i doing wrong!? music wont play - by Axel_Erfurt - Oct-31-2019, 10:08 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Why wont this path work one way, but will the other way? cubangt 2 717 Sep-01-2023, 04:14 PM
Last Post: cubangt
  Am I wrong or is Udemy wrong? String Slicing! Mavoz 3 2,726 Nov-05-2022, 11:33 AM
Last Post: Mavoz
  How can I send a .mp3 to play through my mic? ejected 20 20,761 Sep-01-2022, 02:38 AM
Last Post: victormayer
  Play the next music in a list Pymax 0 1,250 Jul-28-2021, 07:27 PM
Last Post: Pymax
  how do i play an mp3 from a list gr3yali3n 3 2,234 Dec-01-2020, 08:50 AM
Last Post: Axel_Erfurt
  queued music wont play, how to do this? glennford49 0 1,416 Nov-24-2020, 12:54 PM
Last Post: glennford49
  When I import a Module it wont run PyNovice 17 6,676 Oct-26-2019, 11:14 AM
Last Post: PyNovice
  python gives wrong string length and wrong character thienson30 2 3,077 Oct-15-2019, 08:54 PM
Last Post: Gribouillis
  How to play against the computer Help_me_Please 4 4,204 Aug-29-2019, 03:37 PM
Last Post: ThomasL
  Why wont this work? ejected 2 3,273 Mar-29-2019, 05:33 AM
Last Post: snippsat

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020