diff --git a/core/web_search.py b/core/web_search.py new file mode 100644 index 0000000..6fceddd --- /dev/null +++ b/core/web_search.py @@ -0,0 +1,14 @@ +import webbrowser +import ddg + +def search(query: str) -> None: + """Performs a web search using the default browser. + + 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) \ No newline at end of file