Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Doc magic save #225

Closed
wants to merge 1 commit into from

2 participants

@vjyothi

Added examples for %save part of scipy india sprint

@vjyothi vjyothi Examples for %save.
Work done as a team by:
- V.Jyothi
- B.Swathi
- G.Mark
- S.venkatgoud
98b8305
@takluyver
Owner

Thanks, vjyothi. I think that the documentation is clearer without the addition, though - the command is already explained, and the example code doesn't look right (it's not indented, and the prompts don't look like that). I'm going to close this, because I think it's easier to start with a blank slate than to try to work from this, but feel free to have another go, or work on something else.

@damianavila damianavila referenced this pull request from a commit
Commit has since been removed from the repository and is no longer available.
@dwrensha dwrensha referenced this pull request from a commit
@andrewrk andrewrk update to latest music-library-index.
closes #225
closes #196
10db46e
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Dec 18, 2010
  1. @vjyothi

    Examples for %save.

    vjyothi authored
    Work done as a team by:
    - V.Jyothi
    - B.Swathi
    - G.Mark
    - S.venkatgoud
This page is out of date. Refresh to see the latest.
Showing with 32 additions and 2 deletions.
  1. +32 −2 IPython/core/magic.py
View
34 IPython/core/magic.py
@@ -2002,7 +2002,38 @@ def magic_save(self,parameter_s = ''):
filename you specify.
It adds a '.py' extension to the file if you don't do so yourself, and
- it asks for confirmation before overwriting existing files."""
+ it asks for confirmation before overwriting existing files.
+ EXAMPLES
+ ........
+
+ Explanation::
+
+ ln [1]:%save filename.py (starting lineno-ending lineno)
+
+
+ This is used to save the set of lines in specifed file,
+ It takes the extention as ".py".
+ It asks for confirmation before overwriting existing files.
+ To understand more.... see the following exaple
+
+ MULTIPLICATION TABLE
+ - - ------------------------
+ 11:
+ for i in range(1,11):
+ 12:
+ for n in range(1,10):
+ 13:
+ print n,'*',i,'=',n*i
+
+
+
+ IF WE WANT TO SAVE THESE SET OF LINES AS A FILE WE TYPE AS
+ ln[1]:%save mult.py 11-13
+
+
+ """
+
+
opts,args = self.parse_options(parameter_s,'r',mode='list')
fname,ranges = args[0], args[1:]
@@ -3363,5 +3394,4 @@ def magic_tb(self, s):
See %xmode for changing exception reporting modes."""
self.shell.showtraceback()
-
# end Magic
Something went wrong with that request. Please try again.