openerp - How to convert Python Multiple list to list -


here python list when debug it

list: [[4, 1, false], [4, 2, false], [4, 3, false], [4, 4, false], [4, 5, false]] 

now need convert type list

list: [1,2,3,4,5] 

please advice me implement this.

you build list list comprehension:

in [11]: seq out[11]: [[4, 1, false], [4, 2, false], [4, 3, false], [4, 4, false], [4, 5, false]]  in [12]: [item[1] item in seq] out[12]: [1, 2, 3, 4, 5] 

or, use map operator.itemgetter:

in [13]: import operator  in [14]: map(operator.itemgetter(1), seq) out[14]: [1, 2, 3, 4, 5] 

Comments

Popular posts from this blog

Change php variable from jquery value using ajax (same page) -

Pull out data related to my apps from Android Play Store and iOS App Store -

How can I fetch data from a web server in an android application? -