Read / Write image file

codecraig codecraig at gmail.com
Tue May 3 14:12:22 EDT 2005


I have a image file on my pc, say a .jpg.  Basically I want to setup a
client/server socket, and I want the client to read in the jpg and send
it to the server, where the server can write that data into a new file
on the server.

I tried just doing something like..

x = open("abc.jpg")
y = x.read()
tmp = open("newFile.jpg", "w")
tmp.write(y)
tmp.close()
x.close()

...but that doesn't give me a copy of abc.jpg

any ideas?  Thanks




More information about the Python-list mailing list