web search p1

This commit is contained in:
N0\A
2025-10-23 13:36:03 +02:00
parent d8b6d940c4
commit 17c4e938ae

View File

@@ -1,14 +1,6 @@
import webbrowser import webbrowser
import ddg from duckduckgo_search import DDGS
def search(query: str) -> None: def search(query):
"""Performs a web search using the default browser. results = DDGS().text("python programming", max_results=10)
print(results)
Args:
query (str): The search query.
"""
if not query:
raise ValueError("Search query cannot be empty.")
url = f"https://www.google.com/search?q={query.replace(' ', '+')}"
webbrowser.open(url)