1

I'm trying to open an url using python webbrowser module. When the code below runs nothing happens.

import webbrowser 
webbrowser.open_new('http://www.python.org')

But when a sleep time is given, the browser opens and closes after the sleep time is over.

import time
time.sleep(4)

I observed that this happens with Chrome and Firefox. But Edge stays open.

Here Why first part of the code didn't open any browser and the second part causes automatic closing of the windows?

OS: Windows 10, Python: 3.10.5

Shyam3089
  • 459
  • 1
  • 5
  • 20

0 Answers0