Open URL In Browser

Learn how to support different operating systems when opening a browser with a URL.

We'll cover the following

Not everyone uses the same operating system. Different CLIs have different commands. For example, the command to list the content of a directory on a Unix-based operating system is ls, whereas, on Windows, it is dir. In this lesson, I will show you how to support both Windows and Mac when using the os module to open a browser with a URL.

This time though, you will need to spawn a new child process to handle the execution of the browser opening process. Creating a new sub-process requires enough memory in which both the child process and the current program can be executed.

Get hands-on with 1200+ tech skills courses.