Beispiel #1
0
 def convert_notebook(self, fname):
     """Convert an IPython notebook to a Python script in editor"""
     try: 
         script = nbexporter().from_filename(fname)[0]
     except Exception as e:
         QMessageBox.critical(self, _('Conversion error'), 
                              _("It was not possible to convert this "
                              "notebook. The error is:\n\n") + \
                              to_text_string(e))
         return
     self.parent_widget.sig_new_file.emit(script)
Beispiel #2
0
 def convert_notebook(self, fname):
     """Convert an IPython notebook to a Python script in editor"""
     try: 
         script = nbexporter().from_filename(fname)[0]
     except Exception as e:
         QMessageBox.critical(self, _('Conversion error'), 
                              _("It was not possible to convert this "
                              "notebook. The error is:\n\n") + \
                              to_text_string(e))
         return
     self.parent_widget.sig_new_file.emit(script)