Need better way to unpack a list
simon.brunning at gmail.com
Wed Aug 17 10:50:46 CEST 2005
On 8/17/05, Nx <nomail at nomail.com> wrote:
> I want to unpack a list into variables
> the list is created at runtime and I do not know
> how many items there will be , but I know not more than 25.
> The list unpacks into variables which are prev. defined as
> line1,line2....line25 which are actually the names of lineedit fields in
> a Qt gui application and which need to be populated.
> I currently use following to achieve that :
> while c < len(mylinelist):
> c = c + 1
> if c==1:
> if c==2 :
> if c==25:
> I rather have someting like
> pseudo code follows:
> How to do that ?
Lift would be much easier if you held your 'linenn' lineedit fields in
a list instead. Is that possible? If so, you could do something like
for index, line in enumerate(mylinelist):
simon at brunningonline.net,
More information about the Python-list