-3

I am making a voice assistant in python following the tutorial on YouTube by "Code with harry". I have successfully added some more functionalities. The file is of extension .pyw so it runs in the background. The problem I am facing is that sometimes when I run the script it runs as I want it to i.e. always listening for inputs especially after executing a command but most of the time, when I run the script it stops listening after I give it a command. Let's say I asked it to open chrome and it opened it then it would stop listening until I close chrome. How do I fix this?

tutorial link - https://www.youtube.com/watch?v=Lp9Ftuq2sVI&t=1693s

Any help would be really appreciated. Just so you know I am not a pro in coding.

  • 2
    Have you got any example code that we can help you with? – AverageHomosapien Dec 03 '20 at 16:22
  • 2
    it's impossible to answer the question as it is. the problem could be that the control cycle remains on the chrome window and doesn't return to the listening section until you close chrome. you should post some code. if that's too long, a minimal example is enough to show how you handle the execution of commands, such as opening a window on chrome – Wippo Dec 03 '20 at 16:29

1 Answers1

0

I got it working. The culprit was "webbrower.open()" The code stopped once this line ran. So I found an alternative. "os.system()" This worked perfectly.