本文整理汇总了Python中Search.search方法的典型用法代码示例。如果您正苦于以下问题:Python Search.search方法的具体用法?Python Search.search怎么用?Python Search.search使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Search
的用法示例。
在下文中一共展示了Search.search方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: highQuality
# 需要导入模块: import Search [as 别名]
# 或者: from Search import search [as 别名]
def highQuality(self):
global COUNTER
#Search scraper
Search.search()
#Displaying a window massage, telling the user to select their background image
displayBackgroundMessage()
imagePath = getImagePath()
tileFolder = "ImageTiles"
image = Image.open(imagePath)
width = image.size[0]
size = getMuilt(width)
build_mosaic(
input_path = imagePath,
output_path="mosaicImage"+str(COUNTER)+".png",
collection_path= tileFolder,
#Enlarge image
zoom = size,
#Tile size
thumb_size = 20,
fuzz=10,
new_colormap=False
)
COUNTER +=1
displayFinishMessage()
示例2: default
# 需要导入模块: import Search [as 别名]
# 或者: from Search import search [as 别名]
def default(self, line):
if len(line) == 0:
return
if line[-1] == '?':
print Search.search(self.CE, Parser._parse_pred(line[:-1]))
return
try:
self.CE.update(Parser._parse(line))
print 'Accepted'
except:
print traceback.format_exc()
示例3: menu
# 需要导入模块: import Search [as 别名]
# 或者: from Search import search [as 别名]
def menu(host, T, t_host):
while True:
print ("Scegli azione PEER:\nlogin\t - Login\nquit\t - Quit\n\n")
choice = input()
if (choice == "login" or choice == "l"):
t_host, sessionID = logi.login(host, t_host)
if sessionID != bytes(const.ERROR_LOG, "ascii"):
tfunc.success("Session ID: " + str(sessionID, "ascii"))
listPartOwned = {}
daemonThreadP = daemon.PeerDaemon(host, listPartOwned)
daemonThreadP.setName("DAEMON PEER")
daemonThreadP.setDaemon(True)
daemonThreadP.start()
waitingDownload = []
while True:
if len(waitingDownload) == 0:
print ("\n\nScegli azione PEER LOGGATO:\nadd\t - Add File\nsearch\t - Search and Download\nlogout\t - Logout\n\n")
choice_after_log = input()
if (choice_after_log == "add" or choice_after_log == "a"):
add.add(host, sessionID, t_host, listPartOwned)
elif (choice_after_log == "search" or choice_after_log == "s"):
src.search(sessionID, host, t_host, listPartOwned, waitingDownload)
elif (choice_after_log == "logout" or choice_after_log == "l"):
if (logo.logout(host, t_host, sessionID) > 0):
break
else:
tfunc.error("Wrong Choice!")
else:
time.sleep(1)
else:
tfunc.error("Errore Login")
elif (choice == "quit" or choice == "q"):
if T:
logo.quit(host)
break
else:
tfunc.error("Wrong Choice")
示例4: get_new_posts
# 需要导入模块: import Search [as 别名]
# 或者: from Search import search [as 别名]
def get_new_posts(query, collection):
loops = 0
repeat = False
to_be_inserted = []
while (not repeat):
lst = Search.search(query, loops * MAX_QUERY, modifier="create_ts desc")[1]
for post in lst:
if posts_collection.find_one({"item.id":post['item']['id']}):
repeat = True
break
else:
to_be_inserted.append(post)
loops += 1
return to_be_inserted
示例5: mediumQuality
# 需要导入模块: import Search [as 别名]
# 或者: from Search import search [as 别名]
def mediumQuality(self):
global COUNTER
Search.search()
displayBackgroundMessage()
imagePath = getImagePath()
tileFolder = "ImageTiles"
image = Image.open(imagePath)
width = image.size[0]
size = getMuilt(width)
build_mosaic(
input_path = imagePath,
output_path="mosaicImage"+str(COUNTER)+".png",
collection_path= tileFolder,
#Enlarge image
zoom = size,
#Tile size
thumb_size = 40,
fuzz=10,
new_colormap=False
)
COUNTER +=1
displayFinishMessage()
示例6: search
# 需要导入模块: import Search [as 别名]
# 或者: from Search import search [as 别名]
def search(self):
clear = self.clearText.get(1.0, Tkinter.END)
rst = Search.search(clear)
self.encodedText.delete(1.0, Tkinter.END)
content = Search.jsonParser(rst)
display = ""
if (len(content) == 0):
display = "Nothing"
else:
for tweet in content:
key = tweet.keys()[0]
display += key + " said: \n" + "\t" + tweet.get(key) + "\n\n"
checkReport = False
for tweet in content:
if(Search.insertMySQL(tweet)):
checkReport = True
if(checkReport):
tkMessageBox.showinfo("Insert to database", "Insert successfully" )
self.encodedText.insert(1.0, display)
示例7: search
# 需要导入模块: import Search [as 别名]
# 或者: from Search import search [as 别名]
def search(**kwargs):
return Search.search(**kwargs)
示例8: int
# 需要导入模块: import Search [as 别名]
# 或者: from Search import search [as 别名]
#coding=utf-8
import login
import Search
import json
import analysis
if __name__ == '__main__':
client = login.APILogin()
login.browserLogin()
print "========================="
print "1.Run the Search Model"
print "2.Run the Analysis Model"
choice = int(raw_input("Your choice:"))
if choice == 1:
Search.search(client)
elif choice == 2:
analysis.analysis(client)
else:
print "Invalid choice!"