Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #43340

Return a value from a function result

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 <moraa.lovetakes2@gmail.com>
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; '&lt;?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; '&quot;': 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 <moraa.lovetakes2@gmail.com>
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 <python-list.python.org>
List-Unsubscribe <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.449.1365671246.3114.python-list@python.org> (permalink)
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

Show key headers only | View raw


[Multipart message — attachments visible in raw view] - view raw

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

<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope>
   <soapenv:Body>
      <ns1:deliveryStatusResp>
         <ns1:result>
            <address>phone_number</address>
            <deliveryStatus>DeliveredToNetwork</deliveryStatus>
         </ns1:result>
      </ns1:deliveryStatusResp>
   </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
"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

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

Return a value from a function result Ombongi Moraa Fe <moraa.lovetakes2@gmail.com> - 2013-04-11 12:06 +0300

csiph-web