This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import threading | |
from duckduckgo_search import DDGS | |
def do_Search(): | |
with DDGS() as ddgs: | |
searchResults = [r for r in ddgs.text('What is duckduckgo?', max_results=5)] | |
print(searchResults) | |
def main(): | |
x = threading.Thread(target=do_Search) # -> Issue reproduced if not running main thread |