Sophie

Sophie

distrib > Mageia > 5 > x86_64 > media > core-updates > by-pkgid > b9a6a1b9f2781444d2917afd8e4421ab > files > 654

ipython-doc-2.3.0-2.2.mga5.noarch.rpm

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">


<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    
    <title>Module: core.magics.osm &mdash; IPython 2.3.0 documentation</title>
    
    <link rel="stylesheet" href="../../_static/default.css" type="text/css" />
    <link rel="stylesheet" href="../../_static/pygments.css" type="text/css" />
    
    <script type="text/javascript">
      var DOCUMENTATION_OPTIONS = {
        URL_ROOT:    '../../',
        VERSION:     '2.3.0',
        COLLAPSE_INDEX: false,
        FILE_SUFFIX: '.html',
        HAS_SOURCE:  true
      };
    </script>
    <script type="text/javascript" src="../../_static/jquery.js"></script>
    <script type="text/javascript" src="../../_static/underscore.js"></script>
    <script type="text/javascript" src="../../_static/doctools.js"></script>
    <link rel="top" title="IPython 2.3.0 documentation" href="../../index.html" />
    <link rel="up" title="The IPython API" href="../index.html" />
    <link rel="next" title="Module: core.magics.pylab" href="IPython.core.magics.pylab.html" />
    <link rel="prev" title="Module: core.magics.namespace" href="IPython.core.magics.namespace.html" /> 
  </head>
  <body>

<div style="background-color: white; text-align: left; padding: 10px 10px 15px 15px">
<a href="http://ipython.org/"><img src="../../_static/logo.png" border="0" alt="IPython Documentation"/></a>
</div>

    <div class="related">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="../../genindex.html" title="General Index"
             accesskey="I">index</a></li>
        <li class="right" >
          <a href="../../py-modindex.html" title="Python Module Index"
             >modules</a> |</li>
        <li class="right" >
          <a href="IPython.core.magics.pylab.html" title="Module: core.magics.pylab"
             accesskey="N">next</a> |</li>
        <li class="right" >
          <a href="IPython.core.magics.namespace.html" title="Module: core.magics.namespace"
             accesskey="P">previous</a> |</li>
        <li><a href="http://ipython.org">home</a>|&nbsp;</li>
        <li><a href="../../search.html">search</a>|&nbsp;</li>
       <li><a href="../../index.html">documentation </a> &raquo;</li>

          <li><a href="../index.html" accesskey="U">The IPython API</a> &raquo;</li> 
      </ul>
    </div>

      <div class="sphinxsidebar">
        <div class="sphinxsidebarwrapper">
  <h3><a href="../../index.html">Table Of Contents</a></h3>
  <ul>
<li><a class="reference internal" href="#">Module: <tt class="docutils literal"><span class="pre">core.magics.osm</span></tt></a><ul>
<li><a class="reference internal" href="#class">1 Class</a></li>
</ul>
</li>
</ul>

  <h4>Previous topic</h4>
  <p class="topless"><a href="IPython.core.magics.namespace.html"
                        title="previous chapter">Module: <tt class="docutils literal"><span class="pre">core.magics.namespace</span></tt></a></p>
  <h4>Next topic</h4>
  <p class="topless"><a href="IPython.core.magics.pylab.html"
                        title="next chapter">Module: <tt class="docutils literal"><span class="pre">core.magics.pylab</span></tt></a></p>
  <h3>This Page</h3>
  <ul class="this-page-menu">
    <li><a href="../../_sources/api/generated/IPython.core.magics.osm.txt"
           rel="nofollow">Show Source</a></li>
  </ul>
<div id="searchbox" style="display: none">
  <h3>Quick search</h3>
    <form class="search" action="../../search.html" method="get">
      <input type="text" name="q" />
      <input type="submit" value="Go" />
      <input type="hidden" name="check_keywords" value="yes" />
      <input type="hidden" name="area" value="default" />
    </form>
    <p class="searchtip" style="font-size: 90%">
    Enter search terms or a module, class or function name.
    </p>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
        </div>
      </div>

    <div class="document">
      <div class="documentwrapper">
        <div class="bodywrapper">
          <div class="body">
            
  <div class="section" id="module-IPython.core.magics.osm">
<span id="module-core-magics-osm"></span><h1>Module: <tt class="xref py py-mod docutils literal"><span class="pre">core.magics.osm</span></tt><a class="headerlink" href="#module-IPython.core.magics.osm" title="Permalink to this headline">¶</a></h1>
<p>Implementation of magic functions for interaction with the OS.</p>
<p>Note: this module is named &#8216;osm&#8217; instead of &#8216;os&#8217; to avoid a collision with the
builtin.</p>
<div class="section" id="class">
<h2>1 Class<a class="headerlink" href="#class" title="Permalink to this headline">¶</a></h2>
<dl class="class">
<dt id="IPython.core.magics.osm.OSMagics">
<em class="property">class </em><tt class="descclassname">IPython.core.magics.osm.</tt><tt class="descname">OSMagics</tt><big>(</big><em>shell=None</em>, <em>**kwargs</em><big>)</big><a class="headerlink" href="#IPython.core.magics.osm.OSMagics" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="IPython.core.magic.html#IPython.core.magic.Magics" title="IPython.core.magic.Magics"><tt class="xref py py-class docutils literal"><span class="pre">IPython.core.magic.Magics</span></tt></a></p>
<p>Magics to interact with the underlying OS (shell-type functionality).</p>
<dl class="method">
<dt id="IPython.core.magics.osm.OSMagics.alias">
<tt class="descname">alias</tt><big>(</big><em>parameter_s=''</em><big>)</big><a class="headerlink" href="#IPython.core.magics.osm.OSMagics.alias" title="Permalink to this definition">¶</a></dt>
<dd><p>Define an alias for a system command.</p>
<p>&#8216;%alias alias_name cmd&#8217; defines &#8216;alias_name&#8217; as an alias for &#8216;cmd&#8217;</p>
<p>Then, typing &#8216;alias_name params&#8217; will execute the system command &#8216;cmd
params&#8217; (from your underlying operating system).</p>
<p>Aliases have lower precedence than magic functions and Python normal
variables, so if &#8216;foo&#8217; is both a Python variable and an alias, the
alias can not be executed until &#8216;del foo&#8217; removes the Python variable.</p>
<p>You can use the %l specifier in an alias definition to represent the
whole line when the alias is called.  For example:</p>
<div class="highlight-python"><div class="highlight"><pre>In [2]: alias bracket echo &quot;Input in brackets: &lt;%l&gt;&quot;
In [3]: bracket hello world
Input in brackets: &lt;hello world&gt;
</pre></div>
</div>
<p>You can also define aliases with parameters using %s specifiers (one
per parameter):</p>
<div class="highlight-python"><div class="highlight"><pre>In [1]: alias parts echo first %s second %s
In [2]: %parts A B
first A second B
In [3]: %parts A
Incorrect number of arguments: 2 expected.
parts is an alias to: &#39;echo first %s second %s&#39;
</pre></div>
</div>
<p>Note that %l and %s are mutually exclusive.  You can only use one or
the other in your aliases.</p>
<p>Aliases expand Python variables just like system calls using ! or !!
do: all expressions prefixed with &#8216;$&#8217; get expanded.  For details of
the semantic rules, see PEP-215:
<a class="reference external" href="http://www.python.org/peps/pep-0215.html">http://www.python.org/peps/pep-0215.html</a>.  This is the library used by
IPython for variable expansion.  If you want to access a true shell
variable, an extra $ is necessary to prevent its expansion by
IPython:</p>
<div class="highlight-python"><div class="highlight"><pre>In [6]: alias show echo
In [7]: PATH=&#39;A Python string&#39;
In [8]: show $PATH
A Python string
In [9]: show $$PATH
/usr/local/lf9560/bin:/usr/local/intel/compiler70/ia32/bin:...
</pre></div>
</div>
<p>You can use the alias facility to acess all of $PATH.  See the %rehash
and %rehashx functions, which automatically create aliases for the
contents of your $PATH.</p>
<p>If called with no parameters, %alias prints the current alias table.</p>
</dd></dl>

<dl class="method">
<dt id="IPython.core.magics.osm.OSMagics.bang">
<tt class="descname">bang</tt><big>(</big><em>line=''</em>, <em>cell=None</em><big>)</big><a class="headerlink" href="#IPython.core.magics.osm.OSMagics.bang" title="Permalink to this definition">¶</a></dt>
<dd><p>Shell execute - run shell command and capture output (!! is short-hand).</p>
<p>%sx command</p>
<p>IPython will run the given command using commands.getoutput(), and
return the result formatted as a list (split on &#8216;n&#8217;).  Since the
output is _returned_, it will be stored in ipython&#8217;s regular output
cache Out[N] and in the &#8216;_N&#8217; automatic variables.</p>
<p>Notes:</p>
<p>1) If an input line begins with &#8216;!!&#8217;, then %sx is automatically
invoked.  That is, while:</p>
<div class="highlight-python"><div class="highlight"><pre>!ls
</pre></div>
</div>
<p>causes ipython to simply issue system(&#8216;ls&#8217;), typing:</p>
<div class="highlight-python"><div class="highlight"><pre>!!ls
</pre></div>
</div>
<p>is a shorthand equivalent to:</p>
<div class="highlight-python"><div class="highlight"><pre>%sx ls
</pre></div>
</div>
<p>2) %sx differs from %sc in that %sx automatically splits into a list,
like &#8216;%sc -l&#8217;.  The reason for this is to make it as easy as possible
to process line-oriented shell output via further python commands.
%sc is meant to provide much finer control, but requires more
typing.</p>
<p>3) Just like %sc -l, this is a list with special attributes:</p>
<div class="highlight-python"><div class="highlight"><pre>.l (or .list) : value as list.
.n (or .nlstr): value as newline-separated string.
.s (or .spstr): value as whitespace-separated string.
</pre></div>
</div>
<p>This is very useful when trying to use such lists as arguments to
system commands.</p>
</dd></dl>

<dl class="method">
<dt id="IPython.core.magics.osm.OSMagics.bookmark">
<tt class="descname">bookmark</tt><big>(</big><em>parameter_s=''</em><big>)</big><a class="headerlink" href="#IPython.core.magics.osm.OSMagics.bookmark" title="Permalink to this definition">¶</a></dt>
<dd><p>Manage IPython&#8217;s bookmark system.</p>
<p>%bookmark &lt;name&gt;       - set bookmark to current dir
%bookmark &lt;name&gt; &lt;dir&gt; - set bookmark to &lt;dir&gt;
%bookmark -l           - list all bookmarks
%bookmark -d &lt;name&gt;    - remove bookmark
%bookmark -r           - remove all bookmarks</p>
<p>You can later on access a bookmarked folder with:</p>
<div class="highlight-python"><div class="highlight"><pre>%cd -b &lt;name&gt;
</pre></div>
</div>
<p>or simply &#8216;%cd &lt;name&gt;&#8217; if there is no directory called &lt;name&gt; AND
there is such a bookmark defined.</p>
<p>Your bookmarks persist through IPython sessions, but they are
associated with each profile.</p>
</dd></dl>

<dl class="method">
<dt id="IPython.core.magics.osm.OSMagics.cd">
<tt class="descname">cd</tt><big>(</big><em>parameter_s=''</em><big>)</big><a class="headerlink" href="#IPython.core.magics.osm.OSMagics.cd" title="Permalink to this definition">¶</a></dt>
<dd><p>Change the current working directory.</p>
<p>This command automatically maintains an internal list of directories
you visit during your IPython session, in the variable _dh. The
command %dhist shows this history nicely formatted. You can also
do &#8216;cd -&lt;tab&gt;&#8217; to see directory history conveniently.</p>
<p>Usage:</p>
<blockquote>
<div><p>cd &#8216;dir&#8217;: changes to directory &#8216;dir&#8217;.</p>
<p>cd -: changes to the last visited directory.</p>
<p>cd -&lt;n&gt;: changes to the n-th directory in the directory history.</p>
<p>cd &#8211;foo: change to directory that matches &#8216;foo&#8217; in history</p>
<dl class="docutils">
<dt>cd -b &lt;bookmark_name&gt;: jump to a bookmark set by %bookmark</dt>
<dd><dl class="first last docutils">
<dt>(note: cd &lt;bookmark_name&gt; is enough if there is no</dt>
<dd>directory &lt;bookmark_name&gt;, but a bookmark with the name exists.)
&#8216;cd -b &lt;tab&gt;&#8217; allows you to tab-complete bookmark names.</dd>
</dl>
</dd>
</dl>
</div></blockquote>
<p>Options:</p>
<p>-q: quiet.  Do not print the working directory after the cd command is
executed.  By default IPython&#8217;s cd command does print this directory,
since the default prompts do not display path information.</p>
<p>Note that !cd doesn&#8217;t work for this purpose because the shell where
!command runs is immediately discarded after executing &#8216;command&#8217;.</p>
<p class="rubric">Examples</p>
<div class="highlight-python"><div class="highlight"><pre>In [10]: cd parent/child
/home/tsuser/parent/child
</pre></div>
</div>
</dd></dl>

<dl class="method">
<dt id="IPython.core.magics.osm.OSMagics.dhist">
<tt class="descname">dhist</tt><big>(</big><em>parameter_s=''</em><big>)</big><a class="headerlink" href="#IPython.core.magics.osm.OSMagics.dhist" title="Permalink to this definition">¶</a></dt>
<dd><p>Print your history of visited directories.</p>
<p>%dhist       -&gt; print full history%dhist n     -&gt; print last n entries only%dhist n1 n2 -&gt; print entries between n1 and n2 (n2 not included)</p>
<p>This history is automatically maintained by the %cd command, and
always available as the global list variable _dh. You can use %cd -&lt;n&gt;
to go to directory number &lt;n&gt;.</p>
<p>Note that most of time, you should view directory history by entering
cd -&lt;TAB&gt;.</p>
</dd></dl>

<dl class="method">
<dt id="IPython.core.magics.osm.OSMagics.dirs">
<tt class="descname">dirs</tt><big>(</big><em>parameter_s=''</em><big>)</big><a class="headerlink" href="#IPython.core.magics.osm.OSMagics.dirs" title="Permalink to this definition">¶</a></dt>
<dd><p>Return the current directory stack.</p>
</dd></dl>

<dl class="method">
<dt id="IPython.core.magics.osm.OSMagics.env">
<tt class="descname">env</tt><big>(</big><em>parameter_s=''</em><big>)</big><a class="headerlink" href="#IPython.core.magics.osm.OSMagics.env" title="Permalink to this definition">¶</a></dt>
<dd><p>List environment variables.</p>
</dd></dl>

<dl class="method">
<dt id="IPython.core.magics.osm.OSMagics.popd">
<tt class="descname">popd</tt><big>(</big><em>parameter_s=''</em><big>)</big><a class="headerlink" href="#IPython.core.magics.osm.OSMagics.popd" title="Permalink to this definition">¶</a></dt>
<dd><p>Change to directory popped off the top of the stack.</p>
</dd></dl>

<dl class="method">
<dt id="IPython.core.magics.osm.OSMagics.pushd">
<tt class="descname">pushd</tt><big>(</big><em>parameter_s=''</em><big>)</big><a class="headerlink" href="#IPython.core.magics.osm.OSMagics.pushd" title="Permalink to this definition">¶</a></dt>
<dd><p>Place the current dir on stack and change directory.</p>
<dl class="docutils">
<dt>Usage:</dt>
<dd>%pushd [&#8216;dirname&#8217;]</dd>
</dl>
</dd></dl>

<dl class="method">
<dt id="IPython.core.magics.osm.OSMagics.pwd">
<tt class="descname">pwd</tt><big>(</big><em>parameter_s=''</em><big>)</big><a class="headerlink" href="#IPython.core.magics.osm.OSMagics.pwd" title="Permalink to this definition">¶</a></dt>
<dd><p>Return the current working directory path.</p>
<p class="rubric">Examples</p>
<div class="highlight-python"><div class="highlight"><pre>In [9]: pwd
Out[9]: &#39;/home/tsuser/sprint/ipython&#39;
</pre></div>
</div>
</dd></dl>

<dl class="method">
<dt id="IPython.core.magics.osm.OSMagics.pycat">
<tt class="descname">pycat</tt><big>(</big><em>parameter_s=''</em><big>)</big><a class="headerlink" href="#IPython.core.magics.osm.OSMagics.pycat" title="Permalink to this definition">¶</a></dt>
<dd><p>Show a syntax-highlighted file through a pager.</p>
<p>This magic is similar to the cat utility, but it will assume the file
to be Python source and will show it with syntax highlighting.</p>
<p>This magic command can either take a local filename, an url,
an history range (see %history) or a macro as argument</p>
<div class="highlight-python"><div class="highlight"><pre>%pycat myscript.py
%pycat 7-27
%pycat myMacro
%pycat http://www.example.com/myscript.py
</pre></div>
</div>
</dd></dl>

<dl class="method">
<dt id="IPython.core.magics.osm.OSMagics.rehashx">
<tt class="descname">rehashx</tt><big>(</big><em>parameter_s=''</em><big>)</big><a class="headerlink" href="#IPython.core.magics.osm.OSMagics.rehashx" title="Permalink to this definition">¶</a></dt>
<dd><p>Update the alias table with all executable files in $PATH.</p>
<p>This version explicitly checks that every entry in $PATH is a file
with execute access (os.X_OK), so it is much slower than %rehash.</p>
<p>Under Windows, it checks executability as a match against a
&#8216;|&#8217;-separated string of extensions, stored in the IPython config
variable win_exec_ext.  This defaults to &#8216;exe|com|bat&#8217;.</p>
<p>This function also resets the root module cache of module completer,
used on slow filesystems.</p>
</dd></dl>

<dl class="method">
<dt id="IPython.core.magics.osm.OSMagics.sc">
<tt class="descname">sc</tt><big>(</big><em>parameter_s=''</em><big>)</big><a class="headerlink" href="#IPython.core.magics.osm.OSMagics.sc" title="Permalink to this definition">¶</a></dt>
<dd><p>Shell capture - run shell command and capture output (DEPRECATED use !).</p>
<p>DEPRECATED. Suboptimal, retained for backwards compatibility.</p>
<p>You should use the form &#8216;var = !command&#8217; instead. Example:</p>
<blockquote>
<div><p>&#8220;%sc -l myfiles = ls ~&#8221; should now be written as</p>
<p>&#8220;myfiles = !ls ~&#8221;</p>
</div></blockquote>
<p>myfiles.s, myfiles.l and myfiles.n still apply as documented
below.</p>
<p>&#8211;
%sc [options] varname=command</p>
<p>IPython will run the given command using commands.getoutput(), and
will then update the user&#8217;s interactive namespace with a variable
called varname, containing the value of the call.  Your command can
contain shell wildcards, pipes, etc.</p>
<p>The &#8216;=&#8217; sign in the syntax is mandatory, and the variable name you
supply must follow Python&#8217;s standard conventions for valid names.</p>
<p>(A special format without variable name exists for internal use)</p>
<p>Options:</p>
<blockquote>
<div><p>-l: list output.  Split the output on newlines into a list before
assigning it to the given variable.  By default the output is stored
as a single string.</p>
<p>-v: verbose.  Print the contents of the variable.</p>
</div></blockquote>
<p>In most cases you should not need to split as a list, because the
returned value is a special type of string which can automatically
provide its contents either as a list (split on newlines) or as a
space-separated string.  These are convenient, respectively, either
for sequential processing or to be passed to a shell command.</p>
<p>For example:</p>
<div class="highlight-python"><div class="highlight"><pre># Capture into variable a
In [1]: sc a=ls *py

# a is a string with embedded newlines
In [2]: a
Out[2]: &#39;setup.py\nwin32_manual_post_install.py&#39;

# which can be seen as a list:
In [3]: a.l
Out[3]: [&#39;setup.py&#39;, &#39;win32_manual_post_install.py&#39;]

# or as a whitespace-separated string:
In [4]: a.s
Out[4]: &#39;setup.py win32_manual_post_install.py&#39;

# a.s is useful to pass as a single command line:
In [5]: !wc -l $a.s
  146 setup.py
  130 win32_manual_post_install.py
  276 total

# while the list form is useful to loop over:
In [6]: for f in a.l:
  ...:      !wc -l $f
  ...:
146 setup.py
130 win32_manual_post_install.py
</pre></div>
</div>
<p>Similarly, the lists returned by the -l option are also special, in
the sense that you can equally invoke the .s attribute on them to
automatically get a whitespace-separated string from their contents:</p>
<div class="highlight-python"><div class="highlight"><pre>In [7]: sc -l b=ls *py

In [8]: b
Out[8]: [&#39;setup.py&#39;, &#39;win32_manual_post_install.py&#39;]

In [9]: b.s
Out[9]: &#39;setup.py win32_manual_post_install.py&#39;
</pre></div>
</div>
<p>In summary, both the lists and strings used for output capture have
the following special attributes:</p>
<div class="highlight-python"><div class="highlight"><pre>.l (or .list) : value as list.
.n (or .nlstr): value as newline-separated string.
.s (or .spstr): value as space-separated string.
</pre></div>
</div>
</dd></dl>

<dl class="method">
<dt id="IPython.core.magics.osm.OSMagics.sx">
<tt class="descname">sx</tt><big>(</big><em>line=''</em>, <em>cell=None</em><big>)</big><a class="headerlink" href="#IPython.core.magics.osm.OSMagics.sx" title="Permalink to this definition">¶</a></dt>
<dd><p>Shell execute - run shell command and capture output (!! is short-hand).</p>
<p>%sx command</p>
<p>IPython will run the given command using commands.getoutput(), and
return the result formatted as a list (split on &#8216;n&#8217;).  Since the
output is _returned_, it will be stored in ipython&#8217;s regular output
cache Out[N] and in the &#8216;_N&#8217; automatic variables.</p>
<p>Notes:</p>
<p>1) If an input line begins with &#8216;!!&#8217;, then %sx is automatically
invoked.  That is, while:</p>
<div class="highlight-python"><div class="highlight"><pre>!ls
</pre></div>
</div>
<p>causes ipython to simply issue system(&#8216;ls&#8217;), typing:</p>
<div class="highlight-python"><div class="highlight"><pre>!!ls
</pre></div>
</div>
<p>is a shorthand equivalent to:</p>
<div class="highlight-python"><div class="highlight"><pre>%sx ls
</pre></div>
</div>
<p>2) %sx differs from %sc in that %sx automatically splits into a list,
like &#8216;%sc -l&#8217;.  The reason for this is to make it as easy as possible
to process line-oriented shell output via further python commands.
%sc is meant to provide much finer control, but requires more
typing.</p>
<p>3) Just like %sc -l, this is a list with special attributes:</p>
<div class="highlight-python"><div class="highlight"><pre>.l (or .list) : value as list.
.n (or .nlstr): value as newline-separated string.
.s (or .spstr): value as whitespace-separated string.
</pre></div>
</div>
<p>This is very useful when trying to use such lists as arguments to
system commands.</p>
</dd></dl>

<dl class="method">
<dt id="IPython.core.magics.osm.OSMagics.system">
<tt class="descname">system</tt><big>(</big><em>line=''</em>, <em>cell=None</em><big>)</big><a class="headerlink" href="#IPython.core.magics.osm.OSMagics.system" title="Permalink to this definition">¶</a></dt>
<dd><p>Shell execute - run shell command and capture output (!! is short-hand).</p>
<p>%sx command</p>
<p>IPython will run the given command using commands.getoutput(), and
return the result formatted as a list (split on &#8216;n&#8217;).  Since the
output is _returned_, it will be stored in ipython&#8217;s regular output
cache Out[N] and in the &#8216;_N&#8217; automatic variables.</p>
<p>Notes:</p>
<p>1) If an input line begins with &#8216;!!&#8217;, then %sx is automatically
invoked.  That is, while:</p>
<div class="highlight-python"><div class="highlight"><pre>!ls
</pre></div>
</div>
<p>causes ipython to simply issue system(&#8216;ls&#8217;), typing:</p>
<div class="highlight-python"><div class="highlight"><pre>!!ls
</pre></div>
</div>
<p>is a shorthand equivalent to:</p>
<div class="highlight-python"><div class="highlight"><pre>%sx ls
</pre></div>
</div>
<p>2) %sx differs from %sc in that %sx automatically splits into a list,
like &#8216;%sc -l&#8217;.  The reason for this is to make it as easy as possible
to process line-oriented shell output via further python commands.
%sc is meant to provide much finer control, but requires more
typing.</p>
<p>3) Just like %sc -l, this is a list with special attributes:</p>
<div class="highlight-python"><div class="highlight"><pre>.l (or .list) : value as list.
.n (or .nlstr): value as newline-separated string.
.s (or .spstr): value as whitespace-separated string.
</pre></div>
</div>
<p>This is very useful when trying to use such lists as arguments to
system commands.</p>
</dd></dl>

<dl class="method">
<dt id="IPython.core.magics.osm.OSMagics.unalias">
<tt class="descname">unalias</tt><big>(</big><em>parameter_s=''</em><big>)</big><a class="headerlink" href="#IPython.core.magics.osm.OSMagics.unalias" title="Permalink to this definition">¶</a></dt>
<dd><p>Remove an alias</p>
</dd></dl>

<dl class="method">
<dt id="IPython.core.magics.osm.OSMagics.writefile">
<tt class="descname">writefile</tt><big>(</big><em>line</em>, <em>cell</em><big>)</big><a class="headerlink" href="#IPython.core.magics.osm.OSMagics.writefile" title="Permalink to this definition">¶</a></dt>
<dd><div class="highlight-python"><div class="highlight"><pre>%writefile [-a] filename
</pre></div>
</div>
<p>Write the contents of the cell to a file.</p>
<p>The file will be overwritten unless the -a (&#8211;append) flag is specified.</p>
<dl class="docutils">
<dt>positional arguments:</dt>
<dd>filename      file to write</dd>
<dt>optional arguments:</dt>
<dd><table class="first last docutils option-list" frame="void" rules="none">
<col class="option" />
<col class="description" />
<tbody valign="top">
<tr><td class="option-group">
<kbd><span class="option">-a</span>, <span class="option">--append</span></kbd></td>
<td>Append contents of the cell to an existing file. The file will
be created if it does not exist.</td></tr>
</tbody>
</table>
</dd>
</dl>
</dd></dl>

</dd></dl>

</div>
</div>


          </div>
        </div>
      </div>
      <div class="clearer"></div>
    </div>
    <div class="related">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="../../genindex.html" title="General Index"
             >index</a></li>
        <li class="right" >
          <a href="../../py-modindex.html" title="Python Module Index"
             >modules</a> |</li>
        <li class="right" >
          <a href="IPython.core.magics.pylab.html" title="Module: core.magics.pylab"
             >next</a> |</li>
        <li class="right" >
          <a href="IPython.core.magics.namespace.html" title="Module: core.magics.namespace"
             >previous</a> |</li>
        <li><a href="http://ipython.org">home</a>|&nbsp;</li>
        <li><a href="../../search.html">search</a>|&nbsp;</li>
       <li><a href="../../index.html">documentation </a> &raquo;</li>

          <li><a href="../index.html" >The IPython API</a> &raquo;</li> 
      </ul>
    </div>
    <div class="footer">
        &copy; Copyright The IPython Development Team.
      Last updated on Jul 14, 2015.
      Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.2.3.
    </div>
  </body>
</html>