state false active ipython logging can be enabled at any time and it will record your entire session (including previous commandsthusif you are working on something and you decide you want to save everything you didyou can simply enable logging see the docstring of %logstart for more options (including changing the output file path)as well as the companion functions %logoff%logon%logstateand %logstop interacting with the operating system another important feature of ipython is that it provides very strong integration with the operating system shell this meansamong other thingsthat you can perform most standard command line actions as you would in the windows or unix (linuxos xshell without having to exit ipython this includes executing shell commandschanging directoriesand storing the results of command in python object (list or stringthere are also simple shell command aliasing and directory bookmarking features see table - for summary of magic functions and syntax for calling shell commands 'll briefly visit these features in the next few sections table - ipython system-related commands command description !cmd execute cmd in the system shell output !cmd args run cmd and store the stdout in output %alias alias_name cmd define an alias for system (shellcommand %bookmark utilize ipython' directory bookmarking system %cd directory change system working directory to passed directory %pwd return the current system working directory %pushd directory place current directory on stack and change to target directory %popd change to directory popped off the top of the stack %dirs return list containing the current directory stack %dhist print the history of visited directories %env return the system environment variables as dict shell commands and aliases starting line in ipython with an exclamation point !or bangtells ipython to execute everything after the bang in the system shell this means that you can delete files (using rm or deldepending on your os)change directoriesor execute any other process it' even possible to start processes that take control away from ipythoneven another python interpreter ipythonan interactive computing and development environment www it-ebooks info