Hello,
I have the following code in $HOME/.ipython/profile_default/startup/00-first.py:
%alias test echo "Test SUCCESS"
didrun=True
When I open a new notebook and check whether the startup script worked, neither the alias was set, nor the didrun variable is set:
In [1]: test
---------------------------------------------------------------------------
NameError Traceback (most recent call last)
<ipython-input-1-4e1243bd22c6> in <module>
----> 1 test
NameError: name 'test' is not defined
In [2]: didrun
---------------------------------------------------------------------------
NameError Traceback (most recent call last)
<ipython-input-2-b53c54e73e1c> in <module>
----> 1 didrun
NameError: name 'didrun' is not defined
When I remove the %alias command from the startup script, didrun is set as expected.
What do I need to change so that a startup script with magics succeeds? Or is there another configuration option to execute a bunch of commands whenever a new notebook is started?
The %alias is only one example magic command. The solution should apply for any other magic command.
Thank you
Ernst