def save(html,fname=None,launch=False):
html=html_top+html+html_bot<EOL>html=html.replace("<STR_LIT>",swhlab.common.datetimeToString())<EOL>if fname is None:<EOL><INDENT>fname = tempfile.gettempdir()+"<STR_LIT>"<EOL>launch=True<EOL><DEDENT>fname=os.path.abspath(fname)<EOL>with open(fname,'<STR_LIT:w>') as f:<EOL><INDENT>f.write(html)<EOL><DEDENT>global stylesheetSaved<EOL>stylesheetPath=os.path.join(os.path.dirname(fname),"<STR_LIT>")<EOL>if not os.path.exists(stylesheetPath) or stylesheetSaved is False:<EOL><INDENT>with open(stylesheetPath,'<STR_LIT:w>') as f:<EOL><INDENT>f.write(stylesheet)<EOL>stylesheetSaved=True<EOL><DEDENT><DEDENT>if launch:<EOL><INDENT>webbrowser.open(fname)<EOL><DEDENT>
wrap HTML in a top and bottom (with css) and save to disk.