我只想在完成任务后要求hot停止/退出python脚本。
import bs4
import webbrowser
try:
from googlesearch import search
except ImportError:
print("No module named 'google' found")
# to search
query = "recipe for apple strude"
for j in search(query, tld="co.in", num=3, stop=3, pause=3):
webbrowser.open(j)
exit()
打开标签页后,它卡在了
(firefox:22758): Gtk-WARNING **: Theme parsing error: gtk-contained.css:27:19: Missing name of pseudo-class
(firefox:22762): Gtk-WARNING **: Theme parsing error: gtk-contained.css:27:19: Missing name of pseudo-class
(firefox:22750): Gtk-WARNING **: Theme parsing error: gtk-contained.css:2780:55: Not a valid image
(firefox:22758): Gtk-WARNING **: Theme parsing error: gtk-contained.css:2780:55: Not a valid image
(firefox:22762): Gtk-WARNING **: Theme parsing error: gtk-contained.css:2780:55: Not a valid image
每次我必须通过CTRL + C手动退出脚本