This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Modify to support multiple urls in webbrowser.open
Type: enhancement Stage:
Components: Library (Lib) Versions: Python 3.8
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: arlenyu, xtreak
Priority: normal Keywords:

Created on 2019-01-13 19:21 by arlenyu, last changed 2022-04-11 14:59 by admin.

Messages (2)
msg333563 - (view) Author: Arlen (arlenyu) Date: 2019-01-13 19:21
Note: new to python, please provide any feedback

Currently webbrowser.open supports one url, and there is no fn for url batching. I am proposing modifying webbrowser.open to support something along these lines:

```
def open(*urls, new=0, autoraise=True):
        ...
        browser = get(name)
        actions = [browser.open(url, new, autoraise) for url in urls]
        ...

# usage
open('http://example.com', 'http://example2.com')
```
msg333565 - (view) Author: Karthikeyan Singaravelan (xtreak) * (Python committer) Date: 2019-01-13 19:38
Thanks for the report. Since you can do list comprehension over the URLs as in your example I don't see a good reason to change the current API to take multiple URLs.

[browser.open(url, new, autoraise) for url in urls]
History
Date User Action Args
2022-04-11 14:59:10adminsetgithub: 79912
2019-01-13 19:38:32xtreaksetnosy: + xtreak
messages: + msg333565
2019-01-13 19:21:01arlenyucreate