Skip to content

Instantly share code, notes, and snippets.

View fperez's full-sized avatar

Fernando Pérez fperez

View GitHub Profile
@fperez
fperez / magics.md
Created April 16, 2012 04:28
IPEP 1: Cleanup and extension of the Magic system in IPython

IPEP 1: Cleanup and extension of the Magic system in IPython

This document reviews the status of the magic command system in IPython and proposes an extension of magics to work in multiline contexts, at a 'cell' level. The most obvious use of this proposed extension will be the notebook, but the extension will similarly work in the Qt console and even at the terminal.

In the spirit of Python PEPs, this document is marked as IPEP 1, the first 'IPython Enhancement Proposal'.

@fperez
fperez / ipython-0.0.1.py
Created January 8, 2012 21:05
IPython 0.0.1, a simple script to be loaded as $PYTHONSTARTUP: of historical interest only...
#!/usr/bin/env python
"""
Interactive execution with automatic history, tries to mimic Mathematica's
prompt system. This environment's main features are:
- Numbered prompts (In/Out) similar to Mathematica. Only actions that produce
output (NOT assingments, for example) affect the counter and cache.
- The following GLOBAL variables always exist (so don't overwrite them!):
_p: stores previous result which generated printable output.