Is there some way I can use %run to execute a subset of a file?
Something like this:
$ ipython
In [1]: %run my_code.py -L 20 100 # executes lines 20-100 in ipython interpereter
Is there some way I can use %run to execute a subset of a file?
Something like this:
$ ipython
In [1]: %run my_code.py -L 20 100 # executes lines 20-100 in ipython interpereter
Copyright © 2021 Jogjafile Inc.
%run
doesn't have an option for this. You can see all the options it takes by doing%run?
inside IPython.However, you can bring a specific range of lines from a file into the interactive prompt, and run it from there. The syntax to do this looks like: