I'm making a small Python program, which calls the webbrowser
module to open a URL. Opening the URL works wonderfully.
My problem is that once this line of code is reached, the problem is unresponsive. How do I get the program to proceed past this line of code and continue to execute? Below the problematic line is the problematic line, in context:
if viewinbrowser == "y":
print "I can definitely do that. Loading URL now!"
webbrowser.open_new(url)
print "Exiting..."
sys.exit()
The program does not get as far as executing the print "Exiting..."
, which I added because I noticed the program wasn't leaving the if statement for some reason.
I am running this program from the command line, in case that's important. Edit: I am running on Kubuntu 9.04 i386, using KDE 4.3 via backports. I use Firefox 3.5 as my default browser, declared in the System Settings for KDE, and it is called correctly by the program. (At least, a new tab opens up in Firefox with the desired URL—I believe that is the desired functionality.) /Edit
Also, I assume this problem would happen with pretty much any external call, but I'm very new to Python and don't know the terminology to search for on this site. (Searching for "python webbrowser" didn't yield anything helpful.) So, I apologize if it's already been discussed under a different heading!
Any suggestions?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…