ipython/ipython — pull request #3423 by appmathdoc (2013-06-12 20:22:40+00:00)
Title: Added -q option to suppress 'print upon creation' in the %macro  line magic 

Macros are very, very useful and are also somewhat "Matlab" like (and
similar to features in other math/stat environs). Often I (or my students) use a macro to load long complex code from a url -- e.g., large data sets, simulated data,
preprocessing of data, special plotting commands, grading routines...
Currently, this requires defining the macro at the end of the notebook
so when the "print upon creation" occurs it doesn't overwhelm the
notebook (except at the end). The -q option suppresses the print
contents upon creation.

Example with a Matplotlib example (first w/o -q, then with):

In[1]: %macro tmp http://matplotlib.org/mpl_examples/api/date_demo.py
Macro `tmp` created. To execute, type its name (without quotes).
=== Macro contents: ===
#!/usr/bin/env python
"""
Show how to make date plots in matplotlib using date tick locators and
formatters. See major_minor_demo1.py for more information on
controlling major and minor ticks
...

In[2]: %macro -q tmp2 http://matplotlib.org/mpl_examples/api/date_demo.py

(nothing)

Perhaps, though, the first line should print ??? -- e.g.,

Macro `tmp` created. To execute, type its name (without quotes).