Path: csiph.com!usenet.pasdenom.info!aioe.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed4.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.008 X-Spam-Evidence: '*H*': 0.98; '*S*': 0.00; 'parameters': 0.04; 'skip:[ 20': 0.04; 'output': 0.05; 'soap': 0.07; '<?xml': 0.09; 'arguments': 0.09; 'received:209.85.219': 0.09; 'undefined': 0.09; 'python': 0.11; 'def': 0.12; '.........': 0.16; 'b.py': 0.16; 'expecting': 0.16; 'it;': 0.16; 'script,': 0.16; 'value;': 0.16; 'advance.': 0.19; 'basically': 0.19; 'team,': 0.22; 'print': 0.22; 'passes': 0.24; 'skip:e 30': 0.24; 'script': 0.25; 'skip:" 20': 0.27; 'function': 0.29; 'appreciated.': 0.29; 'array': 0.29; 'returned': 0.30; 'skip:& 60': 0.30; 'message-id:@mail.gmail.com': 0.30; 'code': 0.31; '"': 0.31; 'perl': 0.31; 'prints': 0.31; 'saludos': 0.31; 'another': 0.32; 'running': 0.33; 'skip:& 30': 0.33; 'table': 0.34; 'updated': 0.34; 'subject:from': 0.34; 'could': 0.34; 'received:209.85': 0.35; 'received:google.com': 0.35; 'entry': 0.36; 'thanks': 0.36; 'received:209': 0.37; 'server': 0.38; 'skip:& 10': 0.38; 'to:addr:python-list': 0.38; 'skip:& 20': 0.39; 'to:addr:python.org': 0.39; 'either': 0.39; '8bit%:6': 0.40; 'major': 0.40; 'address': 0.63; 'kind': 0.63; 'receive': 0.70; 'therefore': 0.72; 'url:a': 0.72; '.....': 0.78; '..........': 0.84; '\xa0\xa0\xa0\xa0\xa0': 0.84; '\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0': 0.84; '\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0': 0.84; 'faith': 0.91; '\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0': 0.91 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:mime-version:from:date:message-id:subject:to :content-type; bh=NIV6TmMI8857/szdEm2mMTDt/VSVPF16PVaJ5gR4VZM=; b=DhrkTjoXCTr5+z3j+l4scXVZ+aI0UL7H0/7xgoayiCT/a0VI2C7A3RCK39PwoZ3ZWj ZcTskrqCszuFPPY8A4yM48H+lcXWJwNTKqSQO0zwzQaVejgO3pYOxZCBOwB067XWg3QT bMdKY5UlA+ps6VlX9broPxOPNTDNFjfajchYdQ+ZA8LuKU9LtfKXUYxyxw7wjjAzFzPF xcZaJNyvHuJqTWv9X7dVDFAaIqOT2jcKCQQVcmSgyYMBGXhAoFTo0d46LZcW/2YOf/JJ WXH+aLFNcqxYSwwdo2SUJeWwIYy32SinD4TqR+AhCx8H8NDMgwvhhKm8i0aoECmi+R8r 7FRA== X-Received: by 10.60.92.201 with SMTP id co9mr1977701oeb.113.1365671242329; Thu, 11 Apr 2013 02:07:22 -0700 (PDT) MIME-Version: 1.0 From: Ombongi Moraa Fe Date: Thu, 11 Apr 2013 12:06:42 +0300 Subject: Return a value from a function result To: python-list@python.org Content-Type: multipart/alternative; boundary=e89a8f6468574773c404da121d5d X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 142 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1365671246 news.xs4all.nl 2611 [2001:888:2000:d::a6]:42819 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:43340 --e89a8f6468574773c404da121d5d Content-Type: text/plain; charset=ISO-8859-1 Hello Team, My perl script "a.pl" calls python script "b.py" and passes arguments to it; expecting a return value; "b.py" uses suds to facilitate soap-based communication with another server which then returns some value (deliveryStatus) basically, my b.py script has these 3 major parts; #part 1 of code to receive arguments from perl script and process them accordingly .......... ......... #part 2 of code - function to get delivery status def deliveryStatus(): ..... return parameters # or return client.last_received() #part 3- print output of the function print deliveryStatus() running b.py script with the "return parameters" prints this output: [(DeliveryInformation){ address = "phone_number" deliveryStatus = "DeliveredToNetwork" }] running the same script with "return client.last_received() " instead prints the soap output
phone_number
DeliveredToNetwork
With either kind of output returned to my perl script, my table entry is updated as "failed" since the returned value is basically an undefined value; what I need therefore is a way to return only the value "DeliveredToNetwork" so that the database update on my perl script could be correct; A solution using either the soap output or the array output will be appreciated. Someone help me. Thanks in advance. Saludos Ombongi Moraa Faith --e89a8f6468574773c404da121d5d Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
Hello Team,

My perl script "= a.pl" calls python script "b.py"= and passes arguments to it; expecting a return value;

"b.py" uses suds to facilitate soap-based communi= cation with another server which then returns some value (deliveryStatus)
basically, my b.py script has these 3 major parts;

<= /div>
#part 1 of code to receive arguments from perl script and process them acco= rdingly
..........
.........
#part 2 of code - functio= n to get delivery status
def deliveryStatus():
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 .....
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 return parameters # or return = client.last_received()
=A0
#part 3- print output of the function
print deliveryStatus()



running b.py script with = the "return parameters"=A0 prints this output:

[(DeliveryI= nformation){
=A0=A0 address =3D "phone_number"
=A0=A0 deliveryStatus =3D &q= uot;DeliveredToNetwork"
=A0}]


running the sa= me script with =A0 "return client.last_received() " instead print= s the soap output

<?xml version=3D"1.0" encoding=3D"UTF-8"?><soapenv:Envelope>
=A0=A0 <soapenv:Body>
=A0=A0=A0=A0=A0= <ns1:deliveryStatusResp>
=A0=A0=A0=A0=A0=A0=A0=A0 <ns1:result&= gt;
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 <address>phone_number</ad= dress>
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 <deliveryStatus>DeliveredToNetwork&= lt;/deliveryStatus>
=A0=A0=A0=A0=A0=A0=A0=A0 </ns1:result>
= =A0=A0=A0=A0=A0 </ns1:deliveryStatusResp>
=A0=A0 </soapenv:Body= >
</soapenv:Envelope>


With either kind of output returned to my perl script, my table entry= is updated as "failed" since the returned value is basically an = undefined value; what I need therefore is a way to return only the value &q= uot;DeliveredToNetwork" so that the database update on my perl script = could be correct; A solution using either the soap output or the array outp= ut will be appreciated.

Someone help me. Thanks in advance.


=
Saludos

Ombongi Moraa Faith

--e89a8f6468574773c404da121d5d--