I've found a way to run magic commands, eg
from IPython import get_ipython
get_ipython().run_line_magic('matplotlib', 'inline')
but how do you run something like !ls
?
Specifically, I need this to run a console script at runtime in Google Colab.
I have a library called dimcli
that needs to create a local credentials file. Normally I'd invoke it like this !dimcli --init
. However I'd like to run that command automatically each time the library gets loaded.