Show More
@@ -2506,13 +2506,12 b' class InteractiveShell(SingletonConfigurable):' | |||
|
2506 | 2506 | """generator for sequence of code blocks to run""" |
|
2507 | 2507 | if fname.endswith('.ipynb'): |
|
2508 | 2508 | from nbformat import read |
|
2509 |
|
|
|
2510 | nb = read(f, as_version=4) | |
|
2511 |
|
|
|
2512 | return | |
|
2513 |
f |
|
|
2514 |
|
|
|
2515 | yield cell.source | |
|
2509 | nb = read(fname, as_version=4) | |
|
2510 | if not nb.cells: | |
|
2511 | return | |
|
2512 | for cell in nb.cells: | |
|
2513 | if cell.cell_type == 'code': | |
|
2514 | yield cell.source | |
|
2516 | 2515 | else: |
|
2517 | 2516 | with open(fname) as f: |
|
2518 | 2517 | yield f.read() |
General Comments 0
You need to be logged in to leave comments.
Login now