
Discovering the web-browser module
- 2025-02-02
I like that after more than a decade of using Python I can still find something new in it.
Today I used the webbrowser
module for the first time. It allows you to open URLs in the browser installed on the system. It's not new, but I've never had a reason to use it before.
It can be used from the command line or from a script, and is very customisable. You can choose the type of web browser, whether to open the page in a new window or tab, and whether to run in the foreground or background.
Sources: docs.python.org