Re: Save data to a file thru a http connection



yinglcs@xxxxxxxxx wrote:
I am new to python. I read an example here about how to fetch data thru
a HTTP connection:
http://diveintopython.org/http_web_services/review.html,

My question is how can i save the data to a file after reading it from
a http connection.

Do the tutorial and this and many other things will become clear.

Instead of just "print sometext", do something like:
...
f = open('filename', 'w')
...
print >>f, sometext
... (possibly more prints like the above).
f.close()

--Scott David Daniels
scott.daniels@xxxxxxx
.



Relevant Pages

  • Re: Save data to a file thru a http connection
    ... referring to http://docs.python.org/tut/tut.html? ... a HTTP connection: ... Instead of just "print sometext", ... --Scott David Daniels ...
    (comp.lang.python)
  • Re: Save data to a file thru a http connection
    ... a HTTP connection: ... My question is how can i save the data to a file after reading it from ... Usually HTTP is read-only. ... Google for "python webdav" and see how far you get. ...
    (comp.lang.python)
  • Re: Save data to a file thru a http connection
    ... a HTTP connection: ... My question is how can i save the data to a file after reading it from ... Usually HTTP is read-only. ... Google for "python webdav" and see how far you get. ...
    (comp.lang.python)