hello all member n master here, im newbie in python programing, i was litle undersatnd in python, but i've problem in make a syntax for using import module to use search engine like google in my script
like this, this just for example:
root@localhost#python search.py computer info -g
computerinfo.net
www.example.org/info/computer/
etc...
how to make script run like that...
-h = for help
-g = for search in google
-y = for searc in yahoo
-a = for searc in astalavista
n we can combinied optional.....help plis for make that.....thanks before...![]()
I'm not sure of the best way to use any search engine with Python. A few google searches of "python search google" found some promising results. I can't post links yet, so I apologize for not giving you a specific website. "python search google" worked well, try the one that links to indiangeek.
I'm sure this could be modified for other search engines as well just by doing a few quick searches and replacing the necessary URL's.
For the command arguments, I would recommend my tutorial for a starting place on the optparse library. Once again i can't send you the link, but it is found in the Tutorial section.
thanks for ur info, i search first a link....can u give 1 link for "python search google",
What is the exact error you get when importing the module?
I recommend you use the argv list from the sys module for the arguments.
For the search if i were you i'd start by looking for functions on webbrowser module.
For more info on those modules visit the official site of python.
The argv list from the sys module is a difficult way to handle your arguments when multiple options are available. The optparse library uses the argv list to create an easily maintainted form of input.
http://forum.codecall.net/tutorials/...arguments.html
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks