<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
Il 04/06/2013 16:29, Marco De Paoli ha scritto:
<blockquote
cite="mid:CAPz0FjAkmHUtK7=AXjz4YzSnzg1qNfsA2R1vnN6HT8s5Je2QVg@mail.gmail.com"
type="cite"><br>
<br>
<div class="gmail_quote">Il giorno 04 giugno 2013 16:26, Vittorio
Spina <span dir="ltr"><<a moz-do-not-send="true"
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 class="gmail_quote"><br>
</div>
<div class="gmail_quote">vedi qui:</div>
<div class="gmail_quote"><a moz-do-not-send="true"
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 moz-do-not-send="true"
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>
</blockquote>
perfetto, grazie mille.<br>
<blockquote
cite="mid:CAPz0FjAkmHUtK7=AXjz4YzSnzg1qNfsA2R1vnN6HT8s5Je2QVg@mail.gmail.com"
type="cite">
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
Python mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Python@lists.python.it">Python@lists.python.it</a>
<a class="moz-txt-link-freetext" href="http://lists.python.it/mailman/listinfo/python">http://lists.python.it/mailman/listinfo/python</a>
</pre>
</blockquote>
</body>
</html>