##// END OF EJS Templates
Python vs IPython: recommend %cd, %env over !cd, !export (#14629)...
Python vs IPython: recommend %cd, %env over !cd, !export (#14629) https://ipython.readthedocs.io/en/latest/interactive/python-ipython-diff.html#shell-assignment The quick overview mentioned `!cd DIR` among examples of shell commands one might use — but that doesn't work as user would hope (can only affect commands in same ! e.g. `!cd /; pwd`). That's not as bad now that `!cd` prints a warning, but IMHO better to provide the right mental model up front. => Replaced that with minimal motivation why `!cd` and `!export` can't work, recommending some %magic alternatives; moved it out of examples to not distract, and right before Magics section.

File last commit:

r21794:f06a5044
r29044:cb55d942 merge main
Show More
daft_extension.py
12 lines | 285 B | text/x-python | PythonLexer
# -*- coding: utf-8 -*-
"""
Useless IPython extension to test installing and loading extensions.
"""
some_vars = {'arq': 185}
def load_ipython_extension(ip):
# set up simplified quantity input
ip.push(some_vars)
def unload_ipython_extension(ip):
ip.drop_by_id(some_vars)