Closed Thread
Results 1 to 6 of 6

Thread: help using module....

  1. #1
    kiddies is offline Programmer
    Join Date
    May 2009
    Posts
    129
    Rep Power
    0

    Smile help using module....

    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...

  2. CODECALL Circuit advertisement
    Join Date
    Always
    Posts
    Many

     
  3. #2
    ShadenSmith's Avatar
    ShadenSmith is offline Newbie
    Join Date
    May 2009
    Location
    Kentucky - USA
    Posts
    19
    Rep Power
    10

    Re: help using module....

    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.

  4. #3
    kiddies is offline Programmer
    Join Date
    May 2009
    Posts
    129
    Rep Power
    0

    Re: help using module....

    thanks for ur info, i search first a link....can u give 1 link for "python search google",

  5. #4
    CallBackGuy is offline Newbie
    Join Date
    Mar 2009
    Posts
    29
    Rep Power
    0

    Re: help using module....

    What is the exact error you get when importing the module?

  6. #5
    psam is offline Learning Programmer
    Join Date
    Jun 2009
    Posts
    34
    Rep Power
    10

    Re: help using 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.

  7. #6
    ShadenSmith's Avatar
    ShadenSmith is offline Newbie
    Join Date
    May 2009
    Location
    Kentucky - USA
    Posts
    19
    Rep Power
    10

    Re: help using module....

    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

Closed Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. The best module to use
    By ki4jgt in forum Python
    Replies: 1
    Last Post: 11-10-2010, 04:22 PM
  2. example for using module in perl
    By kiddies in forum Perl
    Replies: 2
    Last Post: 07-03-2009, 07:38 AM
  3. what a module can use in C
    By kiddies in forum C and C++
    Replies: 2
    Last Post: 06-14-2009, 07:08 AM
  4. Module Help!
    By J-Camz in forum C and C++
    Replies: 3
    Last Post: 11-27-2008, 03:45 PM
  5. Help please, module in codecall
    By fadiodeh in forum Website Design
    Replies: 3
    Last Post: 09-21-2008, 06:06 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts