Click here to Skip to main content
15,881,852 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
in my code i use
import webbrowser
webbrowser.open('http://google.com', new=2)
and i want when i run this command not to exit my script but keep it running cuz i want to continue the program for example when i say "do you want to search the internet) and the user say yes not to close my program my code is:


import time
time.sleep(2)
print("would you like to go to the internet?")
yeah1=input()
if yeah1=="yes":
print("Ok opening web browser")
time.sleep(4)
import webbrowser
webbrowser.open('http://google.com', new=2)


else:
print("Ok then")

What I have tried:

nothing that is why i am asking here cuz i didnt found a solution
Posted
Updated 13-Nov-18 6:25am

1 solution

If you do not want the program to terminate then you need to create a loop which continues forever.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900