Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 5a2a58e

Browse files
fperezCarreau
authored andcommitted
Document that %run can execute notebooks and ipy scripts.
This feature has been there for a long time but was not documented in the %run docstring. This patch only adds documentation, without changing the functionality.
1 parent 2c958b6 commit 5a2a58e

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

IPython/core/magics/execution.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -522,7 +522,15 @@ def run(self, parameter_s='', runner=None,
522522
523523
%run [-n -i -e -G]
524524
[( -t [-N<N>] | -d [-b<N>] | -p [profile options] )]
525-
( -m mod | file ) [args]
525+
( -m mod | filename ) [args]
526+
527+
The filename argument should be either a pure Python script (with
528+
extension `.py`), or a file with custom IPython syntax (such as
529+
magics). If the latter, the file can be either a script with `.ipy`
530+
extension, or a Jupyter notebook with `.ipynb` extension. When running
531+
a Jupyter notebook, the output from print statements and other
532+
displayed objects will appear in the terminal (even matplotlib figures
533+
will open, if a terminal-compliant backend is being used).
526534
527535
Parameters after the filename are passed as command-line arguments to
528536
the program (put in sys.argv). Then, control returns to IPython's

0 commit comments

Comments
 (0)