Iterating dictionary items + if statement results in problems

Ombongi Moraa Fe moraa.lovetakes2 at gmail.com
Mon Apr 15 06:50:35 EDT 2013


hello Team,

I have this fairly simple script to iterate the dictionary items and check
if the items match certain values;

dictionary={'1234567890':001, '0987654321':002}
for k, v in dictionary.iteritems():
        .....
        .....  #suds client statements;

        if (k == '1234567890' and v == 001):
                criteria='Test'
        elif (k == '0987654321' and v == 002):
                criteria='Running'
        client.service.methodcall(value1,value2,criteria)



During the first run of the dictionary items, the client.service.methodcall
is called only once as expected; and a success initiation response is
received from server. However, during the second run, the
client.service.methodcall is called twice - when i check the log files, i
see the client send request is done twice. Duplicate send requests of the
same parameters results in a error in inititating a connection.

Someone please show me why my second run results in the
client.service.methodcall() running twice. I can't seem to get a hang on
it.

Saludos

Ombongi Moraa Faith
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20130415/b88c8028/attachment.html>


More information about the Python-list mailing list