better right click
This commit is contained in:
14
core/web_search.py
Normal file
14
core/web_search.py
Normal file
@@ -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)
|
||||||
Reference in New Issue
Block a user