What is the difference between ! and % in Jupyter notebooks?

! calls out to a shell (in a new process), while % affects the process associated with the notebook (or the notebook itself; many % commands have no shell counterpart).

!cd foo, by itself, has no lasting effect, since the process with the changed directory immediately terminates.

%cd foo changes the current directory of the notebook process, which is a lasting effect.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)