dictionary - Python: Map with class method which requires arguments -


i need call method set of arguments pyqt5's qtablewidget, particularly pyqt5.qtablewidget.setitem.

i have list of strings,

row = ["a","b","c","d"] 

and need put every element in column of table, except first. tried is

items = [ qtablewidgetitem(r) r in row[1:] ] arguments = zip([rownumber+1]*(len(row)-1), range(1,len(row)), items) putitem = lambda x:tablewidget.setitem(*x) import itertools itertools.starmap(putitem, arguments) 

i tried map , no zip of arguments, nothing seems work. know for loop on arguments, wanted "more elegant" map solution.

the main issue no information displayed in table, though there no error reports nor warning nor anything.

thanks!

a loop more elegant although not terse, imho.

when create generator (as starmap), have consume execute code. example, pass list().


Comments

Popular posts from this blog

aws api gateway - SerializationException in posting new Records via Dynamodb Proxy Service in API -

asp.net - Problems sending emails from forum -