Re: [Tutor] XML-RPC data transfers.

2007-01-01 Thread Ziad Rahhal
Did you look at SOAPpy? if you are interested in doing what you want to do through web-services, then SOAPpy might be what you are looking for. It does support XML-RPC. I have developed a working example that sends an image from a Java Web-service and receives the image at a SOAPpy client that use

Re: [Tutor] extracting numbers from a list

2006-10-16 Thread Ziad Rahhal
On 10/16/06, kumar s <[EMAIL PROTECTED]> wrote: hi :I have a simple question to ask tutors:list A :a = [10,15,18,20,25,30,40]I want to print10 15 (first two elements)16 18 (16 is last number +1)19 2021 2526 3031 40 >>> fx = a[0]>>> fy = a[1]>>> b = a[2:]>>> ai = iter(b)>>> last = ai.next()>>> for j

Re: [Tutor] how to check whether a file exists or not??

2006-10-12 Thread Ziad Rahhal
On 10/12/06, Asrarahmed Kadri <[EMAIL PROTECTED]> wrote: Hello,   Sorry, but this is a very basic questions... Can you tell me how to check the existence of a file..     to check if a file exists, you can use os.path.exists(path)     or look at http://python.org/doc/current/lib/module-os.path.html

Re: [Tutor] From byte[] to Image

2006-09-18 Thread Ziad Rahhal
I do the following: file = StringIO.StringIO(buffer) img = Image.open(file) img.save(file, 'JPEG') I get this error: img = Image.open(file)   File "/home/rahhal/python/lib/python2.4/site-packages/PIL/Image.py", line 1745, in open     raise IOError("cannot identify image file") IOError:

Re: [Tutor] From byte[] to Image

2006-09-18 Thread Ziad Rahhal
I do the following: file = StringIO.StringIO(buffer) img = Image.open(file) img.save(file, 'JPEG') I get this error: img = Image.open(file)   File "/home/rahhal/python/lib/python2.4/site-packages/PIL/Image.py", line 1745, in open     raise IOError("cannot identify image file") IOError: cannot id

Re: [Tutor] From byte[] to Image

2006-09-17 Thread Ziad Rahhal
Hi Alan, The Library I am using is the PIL. And I read the Docs, they say the following about "frombuffer" operation: (Note that this function decodes pixel data only, not entire images. If you have an entire image file in a string, wrap it in a StringIO object, and use open to load it.) So I gu

[Tutor] From byte[] to Image

2006-09-16 Thread Ziad Rahhal
Hi, I convert an Image to bye array in Java (web-services) and send it to a python client. At the client side (python code) i receive the bytes, and then i need to transform them into the image again. Here is what I am doing: #** # fil

[Tutor] Using my own installed python version in my directory tree.

2006-09-13 Thread Ziad Rahhal
Hi, I installed pythin on Linux operating system but on my own tree directory. Now I want to get rid (not deleting) the default python installation, which means I want my own python version to be recognized when I use "python" command. PYTHONPATH has nothing to do with that since it just points t