While in a Jupyter Notebook I am trying to save the result of the IPython %%prun
magic function to a specific file which lives in a subfolder of the current directory, say filename = r'subfoler\profile_result.txt'
. I would like to be able to link this file name via
%%prun -T filename
...
However, when I do this, it just prints the profiler output to a file called filename
in the current directory. This question has a similar problem, for which the solution is to pass in the variable via $filename
. This does not work, and instead just saves the output to a file called $filename
. Is this a bug, is it not possible to do what I want, or am I incorrectly passing in the python variable?