<div dir="ltr"><div>Il giorno 8 febbraio 2016 21:04, Andrea D'Amore <span dir="ltr"><<a href="mailto:and.damore@gmail.com" target="_blank">and.damore@gmail.com</a>></span> ha scritto:<br></div><div><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"><span class="">2016-02-08 19:19 GMT+01:00 Christian Barra <<a href="mailto:barrachri@gmail.com">barrachri@gmail.com</a>>:<br>>> curl -I 'urlDaDoveScaricoUnFileCSV'<br><br>> "<p>Il vino bianco D.O.C. 5 terre � ricavato....<br><br></span>Ok ma l'uscita di curl qual è?</blockquote><div><br></div><div><span style="color:rgb(80,0,80);font-size:12.8px">curl -I 'urlDaDoveScaricoUnFileCSV'</span><br></div><div><span style="color:rgb(80,0,80);font-size:12.8px">poi sono semplicemente andato a riprendere la stringa di testo che ho utilizzato come esempio finora.</span></div><div><span style="color:rgb(80,0,80);font-size:12.8px"><br></span></div><div><font color="#500050"><span style="font-size:12.8px">Problemi con la configurazione in locale ? Potrebbe anche essere....ma ho configurato il bash_profile proprio in mattinata</span></font></div><div><font color="#500050"><span style="font-size:12.8px"><br></span></font></div><div><font color="#500050"><span style="font-size:12.8px"><div style=""># Export LANG</div><div style="">export LANG="en_US.UTF-8"</div><div style="">export LC_MONETARY="it_IT.UTF-8"</div><div style="">export LC_NUMERIC="it_IT.UTF-8"</div><div style="">export LC_TIME="it_IT.UTF-8"</div></span></font></div><div><font color="#500050"><span style="font-size:12.8px"><br></span></font></div><div>Allora...ho fatto un po di test.<span style="color:rgb(80,0,80);font-size:12.8px"><br></span></div><div><span style="color:rgb(80,0,80);font-size:12.8px"><br></span></div><div><div style=""><font color="#500050"><span style="font-size:12.8px">df_witouht_urlib = pd.read_csv(URL,encoding = "latin-1")</span></font></div><div style=""><font color="#500050"><span style="font-size:12.8px">s = df_witouht_urlib.loc[1,"DESCRIZIONE"]</span></font></div><div style=""><font color="#500050"><span style="font-size:12.8px">print(type(s))</span></font></div></div><div style=""><font color="#500050"><span style="font-size:12.8px"><br></span></font></div><div style=""><pre style="overflow:auto;font-size:14px;padding:0px;margin-top:0px;margin-bottom:0px;line-height:17.0001px;word-wrap:break-word;color:rgb(0,0,0);border:0px;border-radius:0px;white-space:pre-wrap;vertical-align:baseline"><class 'str'></pre><pre style="overflow:auto;font-size:14px;padding:0px;margin-top:0px;margin-bottom:0px;line-height:17.0001px;word-wrap:break-word;color:rgb(0,0,0);border:0px;border-radius:0px;white-space:pre-wrap;vertical-align:baseline"><br></pre><pre style="overflow:auto;padding:0px;margin-top:0px;margin-bottom:0px;word-wrap:break-word;border:0px;border-radius:0px;vertical-align:baseline"><font color="#000000"><span style="font-size:14px;line-height:17.0001px;white-space:pre-wrap">s.__repr__()<br></span></font></pre><pre style="overflow:auto;padding:0px;margin-top:0px;margin-bottom:0px;word-wrap:break-word;border:0px;border-radius:0px;vertical-align:baseline"><font color="#000000"><span style="font-size:14px;line-height:17.0001px;white-space:pre-wrap"><br></span></font></pre><pre style="overflow:auto;padding:0px;margin-top:0px;margin-bottom:0px;word-wrap:break-word;border:0px;border-radius:0px;vertical-align:baseline"><pre style="overflow:auto;font-size:14px;padding:0px;margin-top:0px;margin-bottom:0px;line-height:17.0001px;word-wrap:break-word;color:rgb(0,0,0);border:0px;border-radius:0px;white-space:pre-wrap;vertical-align:baseline">'"<p>Il vino bianco D.O.C. 5 terre Ã¨</pre><pre style="overflow:auto;font-size:14px;padding:0px;margin-top:0px;margin-bottom:0px;line-height:17.0001px;word-wrap:break-word;color:rgb(0,0,0);border:0px;border-radius:0px;white-space:pre-wrap;vertical-align:baseline"><br></pre><pre style="overflow:auto;font-size:14px;padding:0px;margin-top:0px;margin-bottom:0px;line-height:17.0001px;word-wrap:break-word;color:rgb(0,0,0);border:0px;border-radius:0px;white-space:pre-wrap;vertical-align:baseline">-----</pre><pre style="overflow:auto;font-size:14px;padding:0px;margin-top:0px;margin-bottom:0px;line-height:17.0001px;word-wrap:break-word;color:rgb(0,0,0);border:0px;border-radius:0px;white-space:pre-wrap;vertical-align:baseline"><br></pre><pre style="overflow:auto;padding:0px;margin-top:0px;margin-bottom:0px;word-wrap:break-word;border:0px;border-radius:0px;vertical-align:baseline"><font color="#000000"><span style="font-size:14px;line-height:17.0001px;white-space:pre-wrap">response = urllib.request.urlretrieve(URL, "data.csv")
df_with_urlib = pd.read_csv("data.csv", encoding = "latin-1")
s = df_with_urlib.loc[1,"DESCRIZIONE"]
print(type(s)</span></font><span style="font-size:14px;line-height:17.0001px;white-space:pre-wrap;color:rgb(0,0,0);font-family:arial,sans-serif">)</span></pre><pre style="overflow:auto;padding:0px;margin-top:0px;margin-bottom:0px;word-wrap:break-word;border:0px;border-radius:0px;vertical-align:baseline"><span style="font-size:14px;line-height:17.0001px;white-space:pre-wrap;color:rgb(0,0,0);font-family:arial,sans-serif"><br></span></pre><pre style="overflow:auto;padding:0px;margin-top:0px;margin-bottom:0px;word-wrap:break-word;border:0px;border-radius:0px;vertical-align:baseline"><pre style="overflow:auto;font-size:14px;padding:0px;margin-top:0px;margin-bottom:0px;line-height:17.0001px;word-wrap:break-word;color:rgb(0,0,0);border:0px;border-radius:0px;white-space:pre-wrap;vertical-align:baseline"><class 'str'></pre></pre></pre></div><div><br></div></div><div>s.__repr__()<br></div><div><br></div><div><pre style="overflow:auto;padding:0px;margin-top:0px;margin-bottom:0px;word-wrap:break-word;border:0px;border-radius:0px;vertical-align:baseline"><pre style="overflow:auto;padding:0px;margin-top:0px;margin-bottom:0px;word-wrap:break-word;border:0px;border-radius:0px;vertical-align:baseline"><pre style="color:rgb(0,0,0);font-size:14px;line-height:17.0001px;white-space:pre-wrap;overflow:auto;padding:0px;margin-top:0px;margin-bottom:0px;word-wrap:break-word;border:0px;border-radius:0px;vertical-align:baseline">'"<p>Il vino bianco D.O.C. 5 terre è ricavato</pre><pre style="color:rgb(0,0,0);font-size:14px;line-height:17.0001px;white-space:pre-wrap;overflow:auto;padding:0px;margin-top:0px;margin-bottom:0px;word-wrap:break-word;border:0px;border-radius:0px;vertical-align:baseline"><br></pre><pre style="color:rgb(0,0,0);font-size:14px;line-height:17.0001px;white-space:pre-wrap;overflow:auto;padding:0px;margin-top:0px;margin-bottom:0px;word-wrap:break-word;border:0px;border-radius:0px;vertical-align:baseline"><pre style="color:rgb(34,34,34);line-height:normal;overflow:auto;padding:0px;margin-top:0px;margin-bottom:0px;word-wrap:break-word;border:0px;border-radius:0px;vertical-align:baseline"><pre style="overflow:auto;padding:0px;margin-top:0px;margin-bottom:0px;line-height:17.0001px;word-wrap:break-word;color:rgb(0,0,0);border:0px;border-radius:0px;white-space:pre-wrap;vertical-align:baseline">-----</pre><div><br></div></pre></pre><pre style="overflow:auto;padding:0px;margin-top:0px;margin-bottom:0px;word-wrap:break-word;border:0px;border-radius:0px;vertical-align:baseline"><font color="#000000"><span style="font-size:14px;line-height:17.0001px;white-space:pre-wrap">response = urllib.request.urlopen(URL)
data = response.read()<br></span></font></pre><pre style="overflow:auto;padding:0px;margin-top:0px;margin-bottom:0px;word-wrap:break-word;border:0px;border-radius:0px;vertical-align:baseline"><font color="#000000"><span style="font-size:14px;line-height:17.0001px;white-space:pre-wrap">print(type(data))<br></span></font></pre><pre style="overflow:auto;padding:0px;margin-top:0px;margin-bottom:0px;word-wrap:break-word;border:0px;border-radius:0px;vertical-align:baseline"><font color="#000000"><span style="font-size:14px;line-height:17.0001px;white-space:pre-wrap"><br></span></font></pre><pre style="overflow:auto;padding:0px;margin-top:0px;margin-bottom:0px;word-wrap:break-word;border:0px;border-radius:0px;vertical-align:baseline"><pre style="overflow:auto;font-size:14px;padding:0px;margin-top:0px;margin-bottom:0px;line-height:17.0001px;word-wrap:break-word;color:rgb(0,0,0);border:0px;border-radius:0px;white-space:pre-wrap;vertical-align:baseline"><class 'bytes'></pre><pre style="overflow:auto;font-size:14px;padding:0px;margin-top:0px;margin-bottom:0px;line-height:17.0001px;word-wrap:break-word;color:rgb(0,0,0);border:0px;border-radius:0px;white-space:pre-wrap;vertical-align:baseline"><br></pre><pre style="overflow:auto;padding:0px;margin-top:0px;margin-bottom:0px;word-wrap:break-word;border:0px;border-radius:0px;vertical-align:baseline"><font color="#000000"><span style="font-size:14px;line-height:17.0001px;white-space:pre-wrap">data.__repr__()<br></span></font></pre><pre style="overflow:auto;padding:0px;margin-top:0px;margin-bottom:0px;word-wrap:break-word;border:0px;border-radius:0px;vertical-align:baseline"><pre style="overflow:auto;font-size:14px;padding:0px;margin-top:0px;margin-bottom:0px;line-height:17.0001px;word-wrap:break-word;color:rgb(0,0,0);border:0px;border-radius:0px;white-space:pre-wrap;vertical-align:baseline">"<p>Il vino bianco D.O.C. 5 terre \\xe8 ricavato</pre><pre style="overflow:auto;font-size:14px;padding:0px;margin-top:0px;margin-bottom:0px;line-height:17.0001px;word-wrap:break-word;color:rgb(0,0,0);border:0px;border-radius:0px;white-space:pre-wrap;vertical-align:baseline"><br></pre><pre style="overflow:auto;padding:0px;margin-top:0px;margin-bottom:0px;word-wrap:break-word;border:0px;border-radius:0px;vertical-align:baseline"><font color="#000000"><span style="font-size:14px;line-height:17.0001px;white-space:pre-wrap">data.decode("latin-1")<br></span></font></pre><pre style="overflow:auto;font-size:14px;padding:0px;margin-top:0px;margin-bottom:0px;line-height:17.0001px;word-wrap:break-word;color:rgb(0,0,0);border:0px;border-radius:0px;white-space:pre-wrap;vertical-align:baseline"><pre style="overflow:auto;padding:0px;margin-top:0px;margin-bottom:0px;line-height:17.0001px;word-wrap:break-word;border:0px;border-radius:0px;white-space:pre-wrap;vertical-align:baseline"><pre style="overflow:auto;padding:0px;margin-top:0px;margin-bottom:0px;line-height:17.0001px;word-wrap:break-word;border:0px;border-radius:0px;white-space:pre-wrap;vertical-align:baseline">"<p>Il vino bianco D.O.C. 5 terre è ricavato</pre><pre style="overflow:auto;padding:0px;margin-top:0px;margin-bottom:0px;line-height:17.0001px;word-wrap:break-word;border:0px;border-radius:0px;white-space:pre-wrap;vertical-align:baseline"><br></pre><pre style="overflow:auto;padding:0px;margin-top:0px;margin-bottom:0px;line-height:17.0001px;word-wrap:break-word;border:0px;border-radius:0px;white-space:pre-wrap;vertical-align:baseline"><br></pre></pre></pre></pre></pre></pre></pre></div></div><div class="gmail_extra"><br><div class="gmail_quote">Il giorno 8 febbraio 2016 21:52, Gollum1 <span dir="ltr"><<a href="mailto:gollum1.smeagol1@gmail.com" target="_blank">gollum1.smeagol1@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"><div class="HOEnZb"><div class="h5">Il 08 febbraio 2016 21:46:37 CET, Roberto Polli <<a href="mailto:robipolli@gmail.com">robipolli@gmail.com</a>> ha scritto:<br>
>Scusate il TP<br>
><br>
>Il 8 febbraio 2016 21:17, Manlio Perillo <<a href="mailto:manlio.perillo@gmail.com">manlio.perillo@gmail.com</a>> ha<br>
>scritto:<br>
>>>> >>> print(repr(s))<br>
>__repr__ don't print ;)<br>
><br>
>Pace,<br>
>R.<br>
>_______________________________________________<br>
>Python mailing list<br>
><a href="mailto:Python@lists.python.it">Python@lists.python.it</a><br>
><a href="http://lists.python.it/mailman/listinfo/python" rel="noreferrer" target="_blank">http://lists.python.it/mailman/listinfo/python</a><br>
<br>
</div></div>Salvato in corner...<br>
O era coroner?<br>
<br>
:-P<br>
<span class="HOEnZb"><font color="#888888">--<br>
Gollum1<br>
<br>
Inviato dal mio dispositivo Android con K-9 Mail. Perdonate la brevità e gli errori di battitura (maledetto correttore ortografico).<br>
</font></span><div class="HOEnZb"><div class="h5">_______________________________________________<br>
Python mailing list<br>
<a href="mailto:Python@lists.python.it">Python@lists.python.it</a><br>
<a href="http://lists.python.it/mailman/listinfo/python" rel="noreferrer" target="_blank">http://lists.python.it/mailman/listinfo/python</a><br>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><br></div>I wish you a good day,<div>Christian</div></div></div></div></div>
</div>