In relation to here, it seems the solution here now works.
(I have outlined and even shared code that's part of this process in the 'In Markdown cells' section of my stackoverflow answer here.)
In relation to here, it seems the solution here now works.
(I have outlined and even shared code that's part of this process in the 'In Markdown cells' section of my stackoverflow answer here.)
| #Useful examples for when converting command line commands from Jupyter/IPython back to Pure Python | |
| # This is party for when need to speed up a `.ipy` script running. It will run much faster as `.py` than as `.ipy` if there | |
| # are a lot of calls to command line / shell commands because saves time by not spawning new shell instance for | |
| # each. (`.ipy` version great for quicker development and proto-typing but `.py` MUCH FASTER for running.) | |
| # The Python versions also have the advantage that you can use them inside functions (I think) because don't have problem like | |
| # with `!cp fn unsanitized_{fn}`or `%store` where actually run in global namespace which cannot see Python variable `fn` | |
| # local to the function. | |
| # RELATED NOTE: You can use the IPython `history` (via the "hist command (with -n to remove line numbers)") to | |
| # help convert `.ipy` code or Jupyter code with exclamation marks and shell commands BACK TO PYTHON, see | |
| # https://stackoverflow.com/a/1040640/8508004 (especially also see the comment by Mic |
| from IPython.display import clear_output | |
| clear_output() | |
| print("") | |
| print("") | |
| print(" __ _ _ __ __ _ ____ _ _ _ _ ") | |
| print(" / \\ / )( \\ / _\\ ( ( \\(_ _)/ )( \\( \\/ ) ") | |
| print(" ( O )) \\/ (/ \\/ / )( ) \\/ (/ \\/ \\ ") | |
| print(" \\__\\)\\____/\\_/\\_/\\_)__) (__) \\____/\\_)(_/ ") | |
| print(" __ _ _ ____ ____ __ _ _ ____ __ _ ____ ____ ____ ") | |
| print(" / _\\ / )( \\( __)/ ___) / \\ ( \\/ )( __)( ( \\( __)/ ___)/ ___)") |
This is to be used in a notebook in sessions launched from my pdbsum-binder.