Jupyter Magic Command
In [ ]:
%lsmagic
Out[ ]:
In [ ]:
%%javascript
alert('javascript');
In [ ]:
import IPython
In [ ]:
from revChatGPT.V1 import Chatbot, configure
bot = Chatbot(
config = configure(),
conversation_id = 'fdf52ab3-f8c1-450f-86f2-5a25d43fc48d',
lazy_loading = True
)
In [ ]:
for response in bot.ask('''
Juypyter Lab 有没有 zsh 的 magic command?
'''):
IPython.display.display(IPython.core.display.Markdown(response['message']))
IPython.display.clear_output(wait=True)
In [ ]:
for response in bot.ask('''
Juypyter Lab 中 zsh 的 magic command 没有加载 ~/.zshrc,该怎么办呢?
'''):
IPython.display.display(IPython.core.display.Markdown(response['message']))
IPython.display.clear_output(wait=True)
In [ ]:
%%bash
cat << EOF >> ~/.zshenv
# Load \`nvm\` in non-interactive shell environments.
if [[ -n "$NVM_DIR" ]]; then
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
fi
EOF
In [ ]:
!zsh -c 'cat ~/.zshenv'
In [ ]:
!zsh -c 'nvm ls'