<!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>color_print — Astropy v0.2.4</title> <link rel="stylesheet" href="../_static/bootstrap-astropy.css" type="text/css" /> <link rel="stylesheet" href="../_static/pygments.css" type="text/css" /> <script type="text/javascript"> var DOCUMENTATION_OPTIONS = { URL_ROOT: '../', VERSION: '0.2.4', 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> <script type="text/javascript" src="../_static/sidebar.js"></script> <link rel="shortcut icon" href="../_static/astropy_logo.ico"/> <link rel="top" title="Astropy v0.2.4" href="../index.html" /> <link rel="up" title="Astropy Core Package Utilities (astropy.utils)" href="../utils/index.html" /> <link rel="next" title="human_time" href="astropy.utils.console.human_time.html" /> <link rel="prev" title="isatty" href="astropy.utils.console.isatty.html" /> </head> <body> <div class="topbar"> <a class="brand" title="Documentation Home" href="../index.html"></a> <ul> <li><a class="homelink" title="AstroPy Homepage" href="http://www.astropy.org"></a></li> <li><a title="General Index" href="../genindex.html">Index</a></li> <li><a title="Python Module Index" href="../py-modindex.html">Modules</a></li> <li> <form action="../search.html" method="get"> <input type="text" name="q" placeholder="Search" /> <input type="hidden" name="check_keywords" value="yes" /> <input type="hidden" name="area" value="default" /> </form> </li> </ul> </div> <div class="related"> <h3>Navigation</h3> <ul> <li class="right"> <a href="astropy.utils.console.human_time.html" title="human_time"> next » </a> </li> <li class="right"> <a href="astropy.utils.console.isatty.html" title="isatty"> « previous </a> | </li> <li> <a href="../index.html">Astropy v0.2.4</a> » </li> <li><a href="../utils/index.html" accesskey="U">Astropy Core Package Utilities (<tt class="docutils literal"><span class="pre">astropy.utils</span></tt>)</a> »</li> <li>color_print</li> </ul> </div> <div class="document"> <div class="documentwrapper"> <div class="bodywrapper"> <div class="body"> <div class="section" id="color-print"> <h1>color_print<a class="headerlink" href="#color-print" title="Permalink to this headline">¶</a></h1> <dl class="function"> <dt id="astropy.utils.console.color_print"> <tt class="descclassname">astropy.utils.console.</tt><tt class="descname">color_print</tt><big>(</big><em>*args</em>, <em>**kwargs</em><big>)</big><a class="reference external" href="http://github.com/astropy/astropy/tree/v0.2.4/astropy/utils/console.py#L194" title="Push the Edit button on the next page"><span class="edit-on-github viewcode-link"> [edit on github]</span></a><a class="reference internal" href="../_modules/astropy/utils/console.html#color_print"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#astropy.utils.console.color_print" title="Permalink to this definition">¶</a></dt> <dd><p>Prints colors and styles to the terminal uses ANSI escape sequences.</p> <div class="highlight-python"><div class="highlight"><pre><span class="n">color_print</span><span class="p">(</span><span class="s">'This is the color '</span><span class="p">,</span> <span class="s">'default'</span><span class="p">,</span> <span class="s">'GREEN'</span><span class="p">,</span> <span class="s">'green'</span><span class="p">)</span> </pre></div> </div> <table class="docutils field-list" frame="void" rules="none"> <col class="field-name" /> <col class="field-body" /> <tbody valign="top"> <tr class="field-odd field"><th class="field-name">Parameters :</th><td class="field-body"><p class="first"><strong>positional args</strong> : strings</p> <blockquote> <div><p>The positional arguments come in pairs (<em>msg</em>, <em>color</em>), where <em>msg</em> is the string to display and <em>color</em> is the color to display it in.</p> <p><em>color</em> is an ANSI terminal color name. Must be one of: black, red, green, brown, blue, magenta, cyan, lightgrey, default, darkgrey, lightred, lightgreen, yellow, lightblue, lightmagenta, lightcyan, white, or ‘’ (the empty string).</p> </div></blockquote> <p><strong>file</strong> : writeable file-like object, optional</p> <blockquote> <div><p>Where to write to. Defaults to <tt class="xref py py-obj docutils literal"><span class="pre">sys.stdout</span></tt>. If file is not a tty (as determined by calling its <a class="reference internal" href="astropy.utils.console.isatty.html#astropy.utils.console.isatty" title="astropy.utils.console.isatty"><tt class="xref py py-obj docutils literal"><span class="pre">isatty</span></tt></a> member, if one exists), no coloring will be included.</p> </div></blockquote> <p><strong>end</strong> : str, optional</p> <blockquote class="last"> <div><p>The ending of the message. Defaults to <tt class="docutils literal"><span class="pre">\n</span></tt>. The end will be printed after resetting any color or font state.</p> </div></blockquote> </td> </tr> </tbody> </table> </dd></dl> </div> </div> </div> </div> <div class="sphinxsidebar"> <div class="sphinxsidebarwrapper"><h3>Page Contents</h3> <ul> <li><a class="reference internal" href="#">color_print</a></li> </ul> </div> </div> <div class="clearer"></div> </div> <footer class="footer"> <p class="pull-right"> <a href="../_sources/_generated/astropy.utils.console.color_print.txt" rel="nofollow">Page Source</a> <a href="#">Back to Top</a></p> <p> © Copyright 2011-2013, The Astropy Developers.<br/> Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.1.3. Last built 22 Oct 2013. <br/> </p> </footer> </body> </html>