Randy,

On Tue, 7 Jan 2003, Randy Heiland wrote:
> Is it possible to use Webware/WebKit from a non-browser client, e.g, from a
> Python or Java client?  I'm hoping/assuming the answer is yes.

to me it seems your question isn't regarding Webware as such but HTTP
client programming. Webware-powered sites usually don't deliver Python
code to clients; Python is only used on the server side.

If I'm right, the answer to your question is yes.

> Anyone have a simple example of such a client that would obtain/display a jpeg
> image?

In Python, you can use the usual facilities as e. g. urllib:

import urllib

content_fileobject = urllib.urlopen('http://somehost.com/image.jpg')
# get the graphics data as a stream of bytes (in a string)
content = content_fileobject.read()
content_fileobject.close()

# do something with the data (store it on disk or move it elsewhere)
# e. g.
graphics_fileobject = open('myimage.jpg', 'wb')
graphics_fileobject.write(content)
graphics_fileobject.close()

See the documentation for the standard module urllib module for more.

Stefan



-------------------------------------------------------
This SF.NET email is sponsored by:
SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
http://www.vasoftware.com
_______________________________________________
Webware-discuss mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/webware-discuss

Reply via email to