I really dislike writing comments like this one and I almost never do, but... this is terrible. It's an amateur project at best that's just a big if/else loop[1] with some very poorly coded[2][3][4] implementations of things.
I get that it might be a cool learning exercise, but if you're in the terminal already what is the value of typing "what time is it" instead of 'date' or "search for a string in file" instead of 'grep'?
It's interesting that this got so many upvotes so quickly, despite it being something similar to what (I'm sure) most of us wrote when we first started learning about computers and programming.
Maybe there's just a demand for a true, text-input, multi-purpose natural language personal assistant on the desktop.
I'm guessing (hoping) most people didn't even actually look at what it was? Maybe they assumed it was related / a remake of Zuckerberg's Jarvis? [1]
As for demand for it, I'm not sure. Allo tried it, there's also a big wave of chat bots starting to get close to it, but I personally still find it it's simple to just do it myself if I'm already on the computer. At least with voice you can do it hands free. As the person above said, why not just use date instead of "what time is it?"
i agree with your latter point but "very poorly coded" is going too far.
He made something that works (although I was a bit underwhelmed as well), and shared it here. Give him some credit.
Maybe instead of just outright saying "exhibit 1,2,3,4 on how shitty this guy's code is", you can give constructive feedback or send a pull request if you are so cautious about code quality.
It listens, you don't type anything. It isn't multi-threaded so it must break from listening when it hears something and runs through all the if statements, spawns the commands and starts listening again.
Seems a fair bit of it was copy pasted without attribution or consent. Normally this wouldn't be a biggie for a (presumably) casual side project, but intellectual property rights are listed explicitly [1] for the website under the "Terms of Use" tab displayed prominently at the top of the page.
I still could never blame someone for showing a little bit of work, or hell even for self-promotion when you're just getting started. But if your gonna copy-pasta you might as well leave the code comments explaining things a little bit!
Side note: Just in case it's not clear to others, the "N.B." notation means "nota bene" (Latin) or "note well" (English) - and it is used to emphasize an important point.
This has already been flagged for some unstated reason...
Unlike come of the other comments, as a non-programmer, I really like this. The code seems so easy to follow and tweak. I'm already getting some ideas on how I can expand on this in terms of coupling the easy english syntax to the underlying linux commands in order to display both outputs (so that newbie command-line users see what's happening behind the scenes). A few other things pop to mind but need to spend some time on the code.
In fact, I think an app like this could probably be even more useful with additional comments embedded in the source - as a learning tool. It's this kind of easy to follow code that gets people excited about programming (especially when they can tweak it right away). It's a program that works very well for what it does, doesn't need documentation except for commenting the code.
The newws.py, for example, is a little difficult to follow right away (and modify for entry-level programmers, non-programmers like myself). Commenting here would have been nice:)
I personally would love to see more apps/code like this but maybe HN isn't the place for this:-( I understand why, it's not a criticism on any deficiency here - as the audience is much more advanced.
Another commenter mentioned that much of the code was taken from a tutorial [0], so it might be worth checking that out :) It goes step by step with commented code and explanations.
Thanks for the link. I looked over the code on the main page only (did not delve deeper) and honestly... it's like night and day. The code by sukeesh is as easy to follow and modify as a simple scripting language. Truly a work of art:)
I've come across similar code that I've been able to immediately cannibalize for personal use on my system. The last time was a script that displayed colored quotes whenever I opened the terminal. Learned an awful lot about coloring text output, randomizing the text and a bit about arrays because it was easy to follow and the app was complete and useful to me. As opposed to learning by snippets.
The tutorial code at pythonspot.com... not terribly friendly I'm afraid (without a detailed tutorial):-( I can understand how an advanced programmer can see logical similarities but the actual code itself scared me away.lol Sorta' like writing the same program: one in rexx and another in bash.
I get that it might be a cool learning exercise, but if you're in the terminal already what is the value of typing "what time is it" instead of 'date' or "search for a string in file" instead of 'grep'?
1. https://github.com/sukeesh/Jarvis/blob/master/main.py#L20-L8...
2. https://github.com/sukeesh/Jarvis/blob/master/evaluator.py#L...
3. https://github.com/sukeesh/Jarvis/blob/master/picshow.py#L12
4. https://github.com/sukeesh/Jarvis/blob/master/todo.py#L38-L7...