<div class="gmail_extra"><div class="gmail_quote">2012/4/24 Lorenzo Macchiavelli <span dir="ltr"><<a href="mailto:lmacchiavelli@gmail.com" target="_blank">lmacchiavelli@gmail.com</a>></span><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<div></div><div>mi restitituisce un errore:
</div><div>exceptions.TypeError:an integer is required</div></blockquote></div><br></div><div class="gmail_extra">Il codice che hai scritto?</div><div class="gmail_extra"><br></div><div class="gmail_extra"><blockquote class="gmail_quote" style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">

<div>out_file = open("test.txt","w")</div><div>out_file.write("prova\n")</div><div>out_file.close()</div></blockquote><div><br></div><div>questo codice restituisce l'errore ( a me no) ?</div>

<div>oppure č BeautifulSoup?</div><div> </div><div>forse manca come lo usi?</div><div><br></div><div>prova questo:</div><div><pre><kbd>from BeautifulSoup import BeautifulSoup</kbd>
<kbd>import re</kbd>
<kbd></kbd>
<kbd>doc = ['<html><head><title>Page title</title></head>',</kbd>
<kbd>       '<body><p id="firstpara" align="center">This is paragraph <b>one</b>.',</kbd>
<kbd>       '<p id="secondpara" align="blah">This is paragraph <b>two</b>.',</kbd>
<kbd>       '</html>']</kbd>
<kbd>soup = BeautifulSoup(''.join(doc))</kbd>
<kbd></kbd>
<kbd>print soup.prettify()</kbd></pre></div></div>