Open multiple web pages with a single 'Double Click'

·

1 min read

If you don't have Python installed then this isn't for you.
GitHub Location Location

I don't want all my favourite web pages opening up when I open the web browser but when I do, I want the simplest solution possible.

The Python built-in library webbrowser is ideal, quick to code, and easy to add to.

Create the main.py file

import webbrowser

def main_function():
    webbrowser.open('https://twitter.com/VincentCHealy')
    webbrowser.open('https://hashnode.com/@vchealy')

if __name__ == "__main__":
    main_function()

# GPL-3.0-or-later

Create the .bat file

@echo off
c:/** Folder Path to python**/python.exe c:/** Path to Python Script**/main.py

Now leave the batch file beside the python code and create a shortcut to this file. Rename and place the shortcut wherever you want it.

Reason:
Well, I found Windows to get a little upset if you use the file directly.
Plus it's always good to be abstracted from the code if you can.