Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

doc new behavior of clients without stdin

  • Loading branch information...
commit baf586a7b5f94206ae90c0d4f4175210d756c1bd 1 parent a42431b
@ivanov authored
Showing with 17 additions and 4 deletions.
  1. +5 −4 IPython/core/history.py
  2. +12 −0 IPython/core/magic.py
View
9 IPython/core/history.py
@@ -762,8 +762,10 @@ def magic_history(self, parameter_s = ''):
the default is the last 10 lines.
-f FILENAME: instead of printing the output to the screen, redirect it to
- the given file. The file is always overwritten, though IPython asks for
- confirmation first if it already exists.
+ the given file. The file is always overwritten, though *when it can*,
+ IPython asks for confirmation first. In particular, running the command
+ "history -f FILENAME" from the IPython Notebook interface will replace
+ FILENAME even if it already exists *without* confirmation.
Examples
--------
@@ -801,12 +803,11 @@ def _format_lineno(session, line):
try:
ans = io.ask_yes_no("File %r exists. Overwrite?" % outfname)
except StdinNotImplementedError:
- print("Overwriting file.")
ans = True
if not ans:
print('Aborting.')
return
-
+ print("Overwriting file.")
outfile = open(outfname,'w')
close_at_end = True
View
12 IPython/core/magic.py
@@ -984,6 +984,12 @@ def magic_reset(self, parameter_s=''):
In [1]: 'a' in _ip.user_ns
Out[1]: False
+
+ Notes
+ -----
+ Calling this magic from clients that do not implement standard input,
+ such as the ipython notebook interface, will reset the namespace
+ without confirmation.
"""
opts, args = self.parse_options(parameter_s,'sf')
if 'f' in opts:
@@ -1056,6 +1062,12 @@ def magic_reset_selective(self, parameter_s=''):
In [11]: who_ls
Out[11]: ['a']
+
+ Notes
+ -----
+ Calling this magic from clients that do not implement standard input,
+ such as the ipython notebook interface, will reset the namespace
+ without confirmation.
"""
opts, regex = self.parse_options(parameter_s,'f')
Please sign in to comment.
Something went wrong with that request. Please try again.