<br><br><div class="gmail_quote">Il giorno 04 giugno 2013 16:26, Vittorio Spina <span dir="ltr"><<a href="mailto:vittorio.spina@gmail.com" target="_blank">vittorio.spina@gmail.com</a>></span> ha scritto:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Come faccio a fare l'overloading del print in modo da non dover eliminare tutti i print presenti nel codice?<br></blockquote><div><br></div><div>puoi provare ridefinendo lo stdout</div><div><br></div>import sys<br>sys.stdout = open('file', 'w') <br>
print 'test'<div></div></div><div class="gmail_quote"><br></div><div class="gmail_quote">vedi qui:</div><div class="gmail_quote"><a href="http://stackoverflow.com/questions/4675728/redirect-stdout-to-a-file-in-python">http://stackoverflow.com/questions/4675728/redirect-stdout-to-a-file-in-python</a></div>
<div class="gmail_quote"><br></div><div class="gmail_quote">e qui:</div><div class="gmail_quote"><a href="http://stackoverflow.com/questions/1218933/can-i-redirect-the-stdout-in-python-into-some-sort-of-string-buffer">http://stackoverflow.com/questions/1218933/can-i-redirect-the-stdout-in-python-into-some-sort-of-string-buffer</a></div>
<br><div>ciao,</div><div>Marco</div>