'Why does Selenium close the page as soon as the script ends?

I am making a small script with Selenium in Python, as soon as the program opens the page and terminates the institutions it immediately closes the Chrome window, how can I prevent the Chrome window from being closed as soon as the program ends?

The code:

From selenium import webdriver
url = “https://www.facebook.com”
driver = webdriver.Chrome()
driver.get(url)


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source