From ce062240f9ff137a7f585d7f13f1144cca22e2e9 2011-12-15 21:52:06 From: Thomas Kluyver Date: 2011-12-15 21:52:06 Subject: [PATCH] Tweak to notebook -> .py export, at Fernando's suggestion. --- diff --git a/IPython/nbformat/v2/nbpy.py b/IPython/nbformat/v2/nbpy.py index e32c642..243bc65 100644 --- a/IPython/nbformat/v2/nbpy.py +++ b/IPython/nbformat/v2/nbpy.py @@ -113,8 +113,8 @@ class PyReader(NotebookReader): class PyWriter(NotebookWriter): def writes(self, nb, **kwargs): - lines = [] - lines.extend([u'# coding: utf-8', u'# 2','']) + lines = [u'# coding: utf-8'] + lines.extend([u'# 2','']) for ws in nb.worksheets: for cell in ws.cells: if cell.cell_type == u'code':