def convert_nb(src, dst, to='html', template_file='basic'):
 from nbconvert import HTMLExporter, RSTExporter
 dispatch = {'rst': RSTExporter, 'html': HTMLExporter}
 exporter = dispatch[to.lower()](template_file=template_file)
 (body, resources) = exporter.from_filename(src)
 with io.open(dst, 'wt', encoding='utf-8') as f:
  f.write(body)
 return dst

def convert_nb ( src , dst , to = 'html' , template_file = 'basic' ) : from nbconvert import HTMLExporter , RSTExporter dispatch = { 'rst' : RSTExporter , 'html' : HTMLExporter } exporter = dispatch [ to . lower ( ) ] ( template_file = template_file ) ( body , resources ) = exporter . from_filename ( src ) with io . open ( dst , 'wt' , encoding = 'utf-8' ) as f : f . write ( body ) return dst
convert a notebook src .