You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am using nbconvert as a package vs command line to convert a notebook to a script using ScriptExporter class in python:
contents, meta = nbconvert.exporters.export(
nbconvert.exporters.ScriptExporter,
notebook
)
When the contents of a notebook cell are all indented by the same amount, this intention is removed in the output. This whitespace should not be removed. Is there already a way to enforce this that I am missing?
A use case for keeping the white space is to enclose multiple output cells within some scope, such as an if statement. For example:
In[1]
if is_true:
In[2]
do_stuff1()
In[3]
do_stuff2()
This allows greater flexibility in using the notebook as a notebook (where you choose the cells to run), and the generated script as a script (e.g. AWS pipelines) without putting scoping statements in every cell.
The text was updated successfully, but these errors were encountered:
I am using nbconvert as a package vs command line to convert a notebook to a script using ScriptExporter class in python:
When the contents of a notebook cell are all indented by the same amount, this intention is removed in the output. This whitespace should not be removed. Is there already a way to enforce this that I am missing?
A use case for keeping the white space is to enclose multiple output cells within some scope, such as an if statement. For example:
This allows greater flexibility in using the notebook as a notebook (where you choose the cells to run), and the generated script as a script (e.g. AWS pipelines) without putting scoping statements in every cell.
The text was updated successfully, but these errors were encountered: