<br><br>On Wednesday, March 4, 2015, David Stanek <<a href="mailto:dstanek@dstanek.com">dstanek@dstanek.com</a>> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Mar 4, 2015 at 6:50 AM, Abhishek Talwar/HYD/TCS <span dir="ltr"><<a href="javascript:_e(%7B%7D,'cvml','abhishek.talwar@tcs.com');" target="_blank">abhishek.talwar@tcs.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">While working on a bug for keystoneclient I have replaced sys.exit with return. However, the code reviewers want that the output should be on stderr(as sys.exit does). So how can we get the output on stderr.</blockquote></div><br>The print function allows you to specify a file:</div><div class="gmail_extra"><br></div><div class="gmail_extra">    >>> from __future__ import print_function<br></div><div class="gmail_extra"><div class="gmail_extra">    >>> import sys<br></div><div class="gmail_extra"></div></div><div class="gmail_extra"><div class="gmail_extra">    >>> print('something to', file=sys.stderr)</div><br clear="all"><div>The __future__ import is needed for Python 2.6/2.7 because print was changed to a function in Python 3.</div></div></div></blockquote><div><br></div><div>I hope that answers your question. Can we have a link to the bug and/or code review?</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div><br></div><div><br></div>-- <br><div>David<br>blog: <a href="http://www.traceback.org" target="_blank">http://www.traceback.org</a><br>twitter: <a href="http://twitter.com/dstanek" target="_blank">http://twitter.com/dstanek</a><div>www: <a href="http://dstanek.com" target="_blank">http://dstanek.com</a></div></div>
</div></div>
</blockquote>