Modify python script

How can I modify this so it uses Seamonkey and goes to Yahoo Advanced Web Search

#!/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))  

Thanks.

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...

I did not write the script and it works fine.

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))

Don't have zenity or seamonkey installed so this is untested:

#!/usr/bin/python3
import os
import urllib
yahoo = os.popen('zenity --entry --text="Enter what you want to yahoo:" --title="yahoo.py"').read()
yahoo = urllib.quote(yahoo)
os.system('seamonkey -new-window https://uk.search.yahoo.com/search?&p=%s' % (yahoo))

I modified yours a little. Sometimes it works, but most of the time I get..
It's very frustrating. :slight_smile:

#!/usr/bin/python3
import os
import urllib
yahoo = os.popen('zenity --entry --text="Enter what you want to yahoo:" --title="yahoo.py"').read()
yahoo = urllib.quote(yahoo)
os.system('seamonkey http://search.yahoo.com/web/advanced/search?q=%s' % (yahoo))

"but most of the time I[/you] get.." what?
A python traceback error?
A zenity error?
A seamonkey error?
A Yahoo error?
Please be more specific.

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'

Saw the original subject and thought it was a Monty Python skit.

Keep your day job. :slight_smile:

------ Post updated at 08:20 PM ------

------ Post updated at 08:21 PM ------

I found the problem.
I was running it incorrectly.

python "/home/andy/bin/yahoo_search.py"