While I am trying to open music from python using speech it was not working properly.
enter image description here
The images of code and the error I am facing was attached
elif 'play music' in query:
music_dir='/home/lokesh/Music/fav'
songs=os.listdir(music_dir)
os.open(os.path.join(music_dir,songs[0]))
help me to correct this
The exception is raised by
os.open
.os.open
method also requiresfalgs
which tells the method in which mode to open the file, for example, in read mode, write mode, etc. You can read about different flags here: https://docs.python.org/3/library/os.html#os.O_RDONLY