diff --git a/IPython/core/magic.py b/IPython/core/magic.py index 3a55bf2..f464d1e 100644 --- a/IPython/core/magic.py +++ b/IPython/core/magic.py @@ -1360,6 +1360,8 @@ Currently the magic system has the following functions:\n""" is generated by a call to the dump_stats() method of profile objects. The profile is still shown on screen. + -q: suppress output to the pager. Best used with -T and/or -D above. + If you want to run complete programs under the profiler's control, use '%run -p [prof_opts] filename.py [args to program]' where prof_opts contains profiler specific options as described here. @@ -1374,7 +1376,7 @@ Currently the magic system has the following functions:\n""" parameter_s = parameter_s.replace('"',r'\"').replace("'",r"\'") if user_mode: # regular user call - opts,arg_str = self.parse_options(parameter_s,'D:l:rs:T:', + opts,arg_str = self.parse_options(parameter_s,'D:l:rs:T:q', list_all=1) namespace = self.shell.user_ns else: # called to run a program by %run -p @@ -1438,7 +1440,8 @@ Currently the magic system has the following functions:\n""" output = stdout_trap.getvalue() output = output.rstrip() - page.page(output) + if 'q' not in opts: + page.page(output) print sys_exit, dump_file = opts.D[0]