new tab in an existing window under internet explorer this is also why didn' need the "file://full url prefix in the preceding listing technicallyinternet explorer is only run if this is what is registered on your computer for the file type being openedif notthat file type' handler is opened instead some imagesfor examplemay open in photo viewer instead on other platformssuch as unix and mac os xbrowser behavior differsand non-url file names might not be openeduse "file://for portability we'll use this module again later in this book for examplethe pymailgui program in will employ it as way to display html-formatted email messages and attachmentsas well as program help see the python library manual for more details in and we'll also meet related callurllib request urlopenwhich fetches web page' text given urlbut does not open it in browserit may be parsedsavedor otherwise used the python mimetypes module to make this media player module even more usefulwe also use the python mimetypes standard library module to automatically determine the media type from the filename we get back type/subtype mime content-type string if the type can be determined or none if the guess failedimport mimetypes mimetypes guess_type('spam jpg'('image/jpeg'nonemimetypes guess_type('thebrightsideoflife mp '('audio/mpeg'nonemimetypes guess_type('lifeofbrian mpg'('video/mpeg'nonemimetypes guess_type('lifeofbrian xyz'(nonenoneunknown type stripping off the first part of the content-type string gives the file' general media typewhich we can use to select generic playerthe second part (subtypecan tell us if text is plain or htmlcontypeencoding mimetypes guess_type('spam jpg'contype split('/')[ 'imagemimetypes guess_type('spam txt'('text/plain'nonemimetypes guess_type('spam html'('text/html'none complete system programs subtype is 'plain