let' explore these briefly before we run the script the python webbrowser module the standard library webbrowser module used by this example provides portable interface for launching web browsers from python scripts it attempts to locate suitable web browser on your local machine to open given url (file or web addressfor display its interface is straightforwardimport webbrowser webbrowser open_new('file://fullfilenameuse os path abspath(this code will open the named file in new web browser window using whatever browser is found on the underlying computeror raise an exception if it cannot you can tailor the browsers used on your platformand the order in which they are attemptedby using the browser environment variable and register function by defaultwebbrowser attempts to be automatically portable across platforms use an argument string of the form "file:/or "computer or web serverrespectively in factyou can pass in any url that the browser understands the following pops up python' home page in new locally-running browser windowfor examplewebbrowser open_new('among other thingsthis is an easy way to display html documents as well as media filesas demonstrated by this section' example for broader applicabilitythis module can be used as both command-line script (python' - module search path flag helps hereand as importable toolc:\users\mark\stuff\websites\public_htmlpython - webbrowser about-pp html :\users\mark\stuff\websites\public_htmlpython - webbrowser - about-pp html :\users\mark\stuff\websites\public_htmlpython - webbrowser - about-pp html :\users\mark\stuff\websites\public_htmlpython import webbrowser webbrowser open('about-pp html'reusenew windownew tab true webbrowser open_new('about-pp html'file:/optional on windows true webbrowser open_new_tab('about-pp html'true in both modesthe difference between the three usage forms is that the first tries to reuse an already-open browser window if possiblethe second tries to open new windowand the third tries to open new tab in practicethoughtheir behavior is totally dependent on what the browser selected on your platform supportsand even on the platform in general all three forms may behave the same playing media files