Once you use urlopen you can read the website like a file<br><br><div class="gmail_quote">On Nov 30, 2007 10:58 AM, mcl <<a href="mailto:mcl.office@googlemail.com">mcl.office@googlemail.com</a>> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div class="Ih2E3d">On 29 Nov, 22:32, TheSeeker <<a href="mailto:duane.kauf...@gmail.com">duane.kauf...@gmail.com</a>> wrote:<br>> On Nov 29, 3:13 pm, mcl <<a href="mailto:mcl.off...@googlemail.com">mcl.off...@googlemail.com
</a>> wrote:<br>><br>><br>><br></div>> > I have been given a url ofCSVfile (<a href="http://hostname/dir/file.csv" target="_blank">http://hostname/dir/file.csv</a>),<br><div class="Ih2E3d">> > which when I put the full URL in a web browser shows the contents of
<br>> > the file.<br>><br></div>> > I want to be able to use theCSVmodule to read that file, which I<br><div class="Ih2E3d">> > have successfully used with a localCSVfile.<br>><br>> > Any examples anywhere would be appreciated.
<br>><br>> > My basic research suggests URLLIB, but I can not find a suitable<br>> > example.<br>><br>> > I do not understand what additional information, needs to be given to<br>> > the remote site in order for it to expose the contents of the file as
<br>> > though I was reading it locally.<br>><br>> > Do I need to copy it to my local machine or can I read it directly<br>> > from the remote site.<br>><br>> > As you can probably tell, I have never done anything like this, so any
<br>> > help will be gratefully received.<br>><br>> > Thanks<br>><br>> > Richard<br>><br>> -----untested------<br>><br>> import urllib,csv<br>><br>> fp_page = urllib.urlopen("
<a href="http://URL_of_file" target="_blank">http://URL_of_file</a>")<br>> reader =csv.reader(fp_page)<br>> for row in reader:<br>> print row<br>><br>> Duane<br><br></div>Duane,<br><br>Brilliant - I had fears of much more complication.
<br><br>Thank you very much<br><br>Richard<br><div><div></div><div class="Wj3C7c"><br>--<br><a href="http://mail.python.org/mailman/listinfo/python-list" target="_blank">http://mail.python.org/mailman/listinfo/python-list
</a><br></div></div></blockquote></div><br><br clear="all"><br>-- <br><a href="http://search.goldwatches.com/?Search=Movado+Watches">http://search.goldwatches.com/?Search=Movado+Watches</a> <br><a href="http://www.goldwatches.com">
http://www.goldwatches.com</a><br><a href="http://www.jewelerslounge.com">http://www.jewelerslounge.com</a>