Changes

Jump to: navigation, search

OPS435 Python Lab 1

15 bytes removed, 07:58, 16 May 2017
Using Magic Functions
:#Lets find out which ones are available, type the following command into the IPython shell:<source>
%alias
</source><br><br>We should now have a list of all the bash commands available in IPython. Shortly we will go over how to add new bash commands into this environment, but you must remember, these are only here to assist in your python scripting, we are not here to learn bash commands.<br><br>
:#Next lets add a new bash command that seems to be missing from this list:<source>
%alias vim vim
ipython3
%vim
</source>You should be seeing an error telling you invalid syntax. This is happening because we need to create a config file to make this alias persist in-between sessions.<br><br>
:#Exit your current IPython session:<source>
exit
:::This should show you a OVERWHELMING amount of information, as we move through the course we will slowly use different magic functions from here, but we will never use all of them. To be continued. Magic functions than just running bash commands. They cover a huge range of different tasks, while we are writing code, allowing us to interactively inspect the Python we are writing and running. Lets move on for now.
13,420
edits

Navigation menu