Last active
January 6, 2023 14:19
-
-
Save Sejmou/15df6a88e8e1232f9b77a9be6918b029 to your computer and use it in GitHub Desktop.
Simple one-liner for printing notebook code without any lines containing only single variable or accessed prop on its own (caution: only works in Unix systems, doesn't detect expressions like 3+4 or tuples containing variables/expressions at end of cell)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jupyter nbconvert --stdout --no-prompt --to script notebook.ipynb | grep -Ev '^\s*\(*[a-zA-Z0-9_\.,\s]+\)*\s*$' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment