#!/usr/bin/python3
import os
import urllib
google = os.popen('zenity --entry --text="Enter what you want to google:
" --title="google.py"').read()
google = urllib.quote(google)
os.system('firefox http://www.google.com/search?q=%s' % (google))
I have no idea how you got this script to work with this line: google = os.popen('zenity --entry --text="Enter what you want to google:
What is your traceback error as this would certainly crash the script.
There are two methods to get out of this probable error:
1) google = os.popen('zenity --entry --text="Enter what you want to google: " --title="google.py"').read() on one line.
OR...
2)
google = os.popen('zenity --entry --text="Enter what you want to google: " \
--title="google.py"').read()
...using the escape '\' character at the end of the 'SPACE' character.
I would use the first...
I have no idea at all about 'zenity' so I have to assume the syntax is correct for that _command_.
As for SeaMonkey until I/we know what the 'google.py' script is I/we have no idea...
And something got messed up when I pasted it here.
And there is no google.py.
Here is correct script. Run it and you can see how it works.
#!/usr/bin/python3
import os
import urllib
google = os.popen('zenity --entry --text="Enter what you want to google: " --title="google.py"').read()
google = urllib.quote(google)
os.system('firefox http://www.google.com/search?q=%s' % (google))
Running the script pops up the attached box, then I get the error below.
python3 /home/andy/bin/yahoo_search.py
Gtk-Message: 17:22:50.240: GtkDialog mapped without a transient parent. This is discouraged.
Traceback (most recent call last):
File "/home/andy/bin/yahoo_search.py", line 5, in <module>
yahoo = urllib.quote(yahoo)
AttributeError: module 'urllib' has no attribute 'quote'