Skip to content

Instantly share code, notes, and snippets.

@hakluke
Created May 18, 2019 15:38
Show Gist options
  • Select an option

  • Save hakluke/0d7d9695e0b59fec43a26c23a1152090 to your computer and use it in GitHub Desktop.

Select an option

Save hakluke/0d7d9695e0b59fec43a26c23a1152090 to your computer and use it in GitHub Desktop.
Little Python script to open a list of URLs from a file in browser tabs, n tabs at a time
#! /usr/bin/python3
import webbrowser, sys
if len(sys.argv) < 3:
print("Usage: openinbrowser.py ./urls.txt 20")
quit()
f = open(sys.argv[1])
tabs = int(sys.argv[2])
counter = 1
for url in f:
counter += 1
webbrowser.open_new_tab(url)
if counter == tabs:
input("Press any key to continue...")
counter = 1
@mtsvnc

mtsvnc commented Mar 26, 2020

Copy link
Copy Markdown

Nice, thanks.

@Rony-C

Rony-C commented Jan 18, 2023

Copy link
Copy Markdown

Thank you for this! Much appreciated

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment