DEV Community

Cover image for Build Virtual Assistant with Python | Automate Tasks

Build Virtual Assistant with Python | Automate Tasks

Rashid on September 03, 2019

This post cross-published with OnePublish What's up DEV Network? Youtube Channel with video tutorials - Reverse Python Youtube In this lab we ar...
Collapse
 
notsag profile image
Maxime Gaston

Hello,

Very good idea and nice project. 👏
I really like the possibilities and the fun!

Regarding the repo, if I may give you some useful tips:

  • do not commit the virtualenv, just use a requirements.txt file
  • if you ask for contribution or offer people to contribute, I'd recommend having some prerequisites. There is a nice article on this matter here
  • your code is not working: IndentationError: unindent does not match any outer indentation level

I'll still follow the repo, it looks very interesting though.

Collapse
 
thedevtimeline profile image
Rashid

Oh I see sorry for this small mistake😅 I already fixed it. I was bit nervous when pushed it😅 Actually yeah requirements.txt will more professional I will add it soon. Thanks for your advice!

Collapse
 
notsag profile image
Maxime Gaston

I issued a PR with some modifications to go with the advices.
I'll be interested in contributing to this 😉

Thread Thread
 
thedevtimeline profile image
Rashid

This is awesome!!😃 Thank you very much!😍

Collapse
 
i_am_faded profile image
Ratul Hasan

Try to add visual items like creating a pygame or tkinter or pyQt5.
Try to use pyttsx or pyttxs3 instead of gTTS. Because it works offline and can be modified (voice, speed, etc). Plus it saves data & time(pyttsx is fast).

Collapse
 
kwancorps profile image
KwanCorps

do you have a way to import pyttsx. this is because I cannot import it into my code: module not found

i have it installed in pip and built a virtuavenv

thx

Collapse
 
fjo_costa profile image
Fernando Costa

Hi!

Looks like you have a very interesting and promising project there.

I'll be following it.

Looks like a storage layer might help there(the 'ifs' and eventually cache to some degree). Maybe sqlite and/or a nosql option for portability reasons.

Collapse
 
thedevtimeline profile image
Rashid

Thank you! Sure, I will implement ML algorithms later so sqlite must be added.

Collapse
 
fjo_costa profile image
Fernando Costa

That would be really nice.
Let us know, here or GitHub, where you're going next.

Collapse
 
bauripalash profile image
Palash Bauri 👻

NLTK could be used to improve the natural language processing instead of manual conditional statements, it would give us for flexibility on understanding the commands. And Please try using 4 spaces instead of tabs..

BTW, Nice Writing! ♥️

Collapse
 
thedevtimeline profile image
Rashid

Yes I am currently focusing on ML with Python. I will try to implement NLTK to this project🤖 Thank you for your advice 👍🙌

Collapse
 
aaditya0407 profile image
Aaditya Banerjee

While trying to search and play an YouTube video, I am getting this error :
"
Traceback (most recent call last):
File "tars.py", line 159, in
tars(myCommand())
File "tars.py", line 137, in tars
webbrowser.open("youtube.com/watch?v={}".format(sea...)
IndexError: list index out of range
"
Someone please help.

Collapse
 
swampcracker8899 profile image
swampcracker8899

Traceback (most recent call last):
File "C:/Users/OWNER/AppData/Local/Programs/Python/Python36/Home.py", line 147, in
home(myCommand())
File "C:/Users/OWNER/AppData/Local/Programs/Python/Python36/Home.py", line 33, in myCommand
talk('Home is ready')
File "C:/Users/OWNER/AppData/Local/Programs/Python/Python36/Home.py", line 22, in talk
text_to_speech.save('audio.mp3')
File "C:\Users\OWNER\AppData\Local\Programs\Python\Python36\lib\site-packages\gtts\tts.py", line 248, in save
with open(str(savefile), 'wb') as f:
PermissionError: [Errno 13] Permission denied: 'audio.mp3'

Collapse
 
johnmelodyme profile image
John Melody Me

I tried this, but usually I got these

Permission denied: 'audio.mp3'

error

Collapse
 
chrisachard profile image
Chris Achard

Nice collection of techniques - really shows of what some simple Python can do!

Collapse
 
thedevtimeline profile image
Rashid

Exactly🚀 This is the power of Python with only basic knownledges💪🐍

Collapse
 
ankurt04 profile image
Ankur Tiwari

This is super cool!

Collapse
 
sachadee profile image
SachaDee

Very nice project ! Thanks

Collapse
 
iceorfiresite profile image
Ice or Fire

This is very cool! Thanks for sharing this. Do you have a voice assistant written in python that uses machine learning?

Collapse
 
thedevtimeline profile image
Rashid

Not yet, but I am thinking to add some ML algorithms later🚀

Collapse
 
nicolaerario profile image
Nicola Erario

Really a nice reading!

Collapse
 
deven96 profile image
Diretnan Domnan

What VSCode theme are you using

Collapse
 
thedevtimeline profile image
Rashid

Shades of Purple :)

Collapse
 
_sachin__thakur profile image
Sachin Thakur

Hey I was trying this and I found this error:" Could not find PyAudio; check installation " which I try to resolve with pip install PyAudio version0.2.11 is the latest version available while running this I am getting above mentioned error how should I resolve please do help me out

Collapse
 
futuregeek141 profile image
Nayan

stackoverflow.com/questions/522838...

Refer this thread, you have to install manually..

Collapse
 
sk2223131 profile image
sandeep • Edited

Anybody help me to fix this problem

Collapse
 
manalshaikhinfo profile image
Manal Shaikh

Well, I'm having an issue.
Because file with the same name is getting over and over again.

Collapse
 
codeperfectplus profile image
Deepak Raj

Informative article, Thanks for posting

Collapse
 
anishde12020 profile image
Anish De

I have an issue where the permission to the audio.mp3 file is denied

Collapse
 
shreyasdixit3012 profile image
ShreyasDixit3012

Well i did a simple fix where you name the file with the current date and time using datetime.datetime.now()
However initially it showed errors but when i removed the characters such as : and - the only digit strings worked.
Can anybody suggest something better tho cause this issue seems common.

Collapse
 
elvinaqa profile image
Elvin Aghammadzada

well done

Collapse
 
erraghavkhanna profile image
Raghav Khanna

Amazing💕😍