Show More
@@ -762,8 +762,10 b" def magic_history(self, parameter_s = ''):" | |||
|
762 | 762 | the default is the last 10 lines. |
|
763 | 763 | |
|
764 | 764 | -f FILENAME: instead of printing the output to the screen, redirect it to |
|
765 |
the given file. The file is always overwritten, though |
|
|
766 | confirmation first if it already exists. | |
|
765 | the given file. The file is always overwritten, though *when it can*, | |
|
766 | IPython asks for confirmation first. In particular, running the command | |
|
767 | "history -f FILENAME" from the IPython Notebook interface will replace | |
|
768 | FILENAME even if it already exists *without* confirmation. | |
|
767 | 769 | |
|
768 | 770 | Examples |
|
769 | 771 | -------- |
@@ -801,12 +803,11 b" def magic_history(self, parameter_s = ''):" | |||
|
801 | 803 | try: |
|
802 | 804 | ans = io.ask_yes_no("File %r exists. Overwrite?" % outfname) |
|
803 | 805 | except StdinNotImplementedError: |
|
804 | print("Overwriting file.") | |
|
805 | 806 | ans = True |
|
806 | 807 | if not ans: |
|
807 | 808 | print('Aborting.') |
|
808 | 809 | return |
|
809 | ||
|
810 | print("Overwriting file.") | |
|
810 | 811 | outfile = open(outfname,'w') |
|
811 | 812 | close_at_end = True |
|
812 | 813 |
@@ -984,6 +984,12 b' Currently the magic system has the following functions:\\n"""' | |||
|
984 | 984 | |
|
985 | 985 | In [1]: 'a' in _ip.user_ns |
|
986 | 986 | Out[1]: False |
|
987 | ||
|
988 | Notes | |
|
989 | ----- | |
|
990 | Calling this magic from clients that do not implement standard input, | |
|
991 | such as the ipython notebook interface, will reset the namespace | |
|
992 | without confirmation. | |
|
987 | 993 | """ |
|
988 | 994 | opts, args = self.parse_options(parameter_s,'sf') |
|
989 | 995 | if 'f' in opts: |
@@ -1056,6 +1062,12 b' Currently the magic system has the following functions:\\n"""' | |||
|
1056 | 1062 | |
|
1057 | 1063 | In [11]: who_ls |
|
1058 | 1064 | Out[11]: ['a'] |
|
1065 | ||
|
1066 | Notes | |
|
1067 | ----- | |
|
1068 | Calling this magic from clients that do not implement standard input, | |
|
1069 | such as the ipython notebook interface, will reset the namespace | |
|
1070 | without confirmation. | |
|
1059 | 1071 | """ |
|
1060 | 1072 | |
|
1061 | 1073 | opts, regex = self.parse_options(parameter_s,'f') |
General Comments 0
You need to be logged in to leave comments.
Login now