0

I have created the following Python code that reads a method from a webservice:

def GetWeatherParameters():
""""""
client = Client('www.address.asmx?wsdl')
#WebServiceClient.GetWeatherParameters()

return client.service.GetWeatherParameters()

It works fine and I get the data returned and can print it, however the data returned contains mutltiple columns and this code just prints out everything at once.

Does anybody know how I can extract the returned data column by column?

the Tin Man
  • 158,662
  • 42
  • 215
  • 303
user1810659
  • 221
  • 2
  • 7
  • 18

1 Answers1

0

It all depends on the returned data - a handy way to display it nicely is to use pprint:

from pprint import pprint
pprint(your_data)

That'll format it nicely so it's easier to see the structure. Then if it's a list or similar, to get the first row you can do your_data[0] to get the first one, or loop, to print it row by row:

for row in your_data:
    print row
    print row[0] # could be the first column...

And go from there...

Jon Clements
  • 138,671
  • 33
  • 247
  • 280