def browser(self): target=Browser() if self.txt.find("谷歌") > -1 or self.txt.find("google")>-1 : self.setCmdFlag(True) target.docmd("www.google.com.hk") elif self.txt.find("百度") > -1: self.setCmdFlag(True) target.docmd("www.baidu.com") elif self.txt.find("新浪") > -1: self.setCmdFlag(True) target.docmd("www.sina.com.cn") elif self.txt.find("火狐") > -1: self.setCmdFlag(True) target.docmd("ww.echocool.net")
def googleSearch(self): q=urllib.quote_plus((u'%s'%self.txt).encode('utf8')) searchquri="https://www.google.com.hk/search?newwindow=1\&safe=active\&hl=en\&site=webhp\&source=hp\&q=%s&oq=%s"%(q,q) target=Browser() target.docmd(searchquri)