Hi Ive been trying with yield all day and other different things :D
but I always get the same result using yield
Fault: <Fault 1: "<type 'exceptions.TypeError'>:cannot marshal <type
'generator'
> objects">
I'm not sure exactly what I am doing wrong as this is the first time Ive
used yield
Any suggestions on how to fix this error
Cheers
Andrew
Christian Heimes wrote:
Andrew wrote:
Hi I was wondering if there is anyway with XML RPC to send a string of
text from the server to the client with out calling return thus
breaking my loop
for example
def somefunc():
for action, files in results:
full_filename = os.path.join(path_to_watch, files)
theact = ACTIONS.get(action, "Unknown")
out2 = str(full_filename) + " " + str(theact)
return out2
the return statement will return a result breaking my loop. My goal is
to have it continue looping and updating the client
any ideas?
Yes, use yield instead of return. It turns the function into a generator.
Christian
--
http://mail.python.org/mailman/listinfo/python-list