Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #49890 > unrolled thread
| Started by | robert.winkler@bioprocess.org |
|---|---|
| First post | 2013-07-04 10:57 -0700 |
| Last post | 2013-07-05 22:41 +0300 |
| Articles | 2 — 2 participants |
Back to article view | Back to comp.lang.python
Convert SOAP response (ArrayOfInt) to Python list robert.winkler@bioprocess.org - 2013-07-04 10:57 -0700
Re: Convert SOAP response (ArrayOfInt) to Python list Burak Arslan <burak.arslan@arskom.com.tr> - 2013-07-05 22:41 +0300
| From | robert.winkler@bioprocess.org |
|---|---|
| Date | 2013-07-04 10:57 -0700 |
| Subject | Convert SOAP response (ArrayOfInt) to Python list |
| Message-ID | <502d34a9-551c-4939-b570-f6d7c92051bd@googlegroups.com> |
Thanks to the OSA library, which works for SOAP requests with Python 3.x, I can now use SOAP services at http://www.chemspider.com.
The results structure is
<GetAsyncSearchResultResult>
<int>int</int>
<int>int</int>
</GetAsyncSearchResultResult>
The result is a list of accession numbers (which correspond to chemical compounds) and I get them in the following format:
(ArrayOfInt){
int[] = [
5744,
69182,
292,
68027,
3404131,
82616,
18280,
11200,
704646,
543430
...
]
}
How could I transform this to a simple python list?
[5744, 69182, 292,68027, 3404131, 82616, 18280, 11200, 704646, 543430 ...]
Conversion to a numpy array (and subsequent list(), or similar) does not solve the problem, since the structure is maintained; the numpy.shape returns ().
Suggestions?
[toc] | [next] | [standalone]
| From | Burak Arslan <burak.arslan@arskom.com.tr> |
|---|---|
| Date | 2013-07-05 22:41 +0300 |
| Message-ID | <mailman.4307.1373053837.3114.python-list@python.org> |
| In reply to | #49890 |
Hi, FYI, There's a soap-specific python.org list: soap@python.org On 07/04/13 20:57, robert.winkler@bioprocess.org wrote: > Thanks to the OSA library, which works for SOAP requests with Python 3.x, I can now use SOAP services at http://www.chemspider.com. > > The results structure is > <GetAsyncSearchResultResult> > <int>int</int> > <int>int</int> > </GetAsyncSearchResultResult> > > The result is a list of accession numbers (which correspond to chemical compounds) and I get them in the following format: > > [snip] > > How could I transform this to a simple python list? I did not use OSA, but assuming print(ret) prints that, you should do ret.int to get your list. It should already be a regular Python list. I hope that helps. Best, Burak
[toc] | [prev] | [standalone]
Back to top | Article view | comp.lang.python
csiph-web