Last active
February 11, 2024 02:51
-
-
Save kspviswa/6efe09b937af61315cec2f585eea60f5 to your computer and use it in GitHub Desktop.
Gist explaining the issue with v4.4.1 of duckduckgo_search
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 | |
x.start() | |
x.join() | |
# do_Search(). --> Uncomment this line and comment line #10-12 if running is main thread | |
if __name__ == '__main__': | |
main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment