#working with python threads and json....the programing in going crazy

16 messages · Page 1 of 1 (latest)

light lily
#

output:

play

Songs/Boys Feel Sad Too.mp3

stop

Music stopped

Songs/Build a Bitch.mp3

Songs/Change My Clothes.mp3

Songs/Cheap Thrills.mp3

Songs/Cheap Thrills.mp3

Songs/Counting Stars.mp3

Songs/Cradles.mp3

Songs/Cradles.mp3

Songs/DARKSIDE.mp3

Songs/Dandelions.mp3

Songs/Dark Horse.mp3

Songs/Dernière danse.mp3

Songs/Dernière danse.mp3

Songs/Die For You.mp3

Songs/Die For You.mp3

Songs/Die a King.mp3

Exception in thread Thread-24 (autoplayNextSong):
Traceback (most recent call last):
File "C:\Users\usr\AppData\Local\Programs\Python\Python311\Lib\threading.py", line 1038, in _bootstrap_inner
self.run()
File "C:\Users\usr\AppData\Local\Programs\Python\Python311\Lib\threading.py", line 975, in run
self._target(*self.args, **self.kwargs)
File "c:\Data\Programming\Python\systerm\main.py", line 168, in autoplayNextSong
nextSong(args, songsDir, songsList)
File "c:\Data\Programming\Python\systerm\main.py", line 172, in nextSong
songNumData = load(songNumFile)
^^^^^^^^^^^^^^^^^
File "C:\Users\usr\AppData\Local\Programs\Python\Python311\Lib\json_init
.py", line 293, in load
return loads(fp.read(),
^^^^^^^^^^^^^^^^
File "C:\Users\usr\AppData\Local\Programs\Python\Python311\Lib\json_init
.py", line 346, in loads
return _default_decoder.decode(s)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\usr\AppData\Local\Programs\Python\Python311\Lib\json\decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\usr\AppData\Local\Programs\Python\Python311\Lib\json\decoder.py", line 355, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
Traceback (most recent call last):

grizzled flintBOT
#

@light lily

Oni~Chan Uploaded Some Code

code:

Uploaded these files to a Gist
light lily
#

code ^

#

so this is a cli program which controls my computer and makes it do alot of stuff

#

but currently i am trying to add a music player to this

#

and when i run play the music plays

#

fine

#

and it also autoplays next

#

but when i try to stop the music using stop command the program goes crazy by looking at the out put you will understand

#

it lists all the songs in the songs dir

#

i did not code that in

#

it outputs them on its own

#

idk what is going on

#

it happed when i added threads to this

#

and i am new to threads so that can be the problem