You could use a list comprehension return [self.settings.value(field) for field in self.FIELDS] On Jan 30, 2013 10:21 PM, "Panupat Chongstitwattana" <[email protected]> wrote:
> Hi Justin. > > I'm curious if there's a more pythonic way to iterate this? > > self.FIELDS = [ 'width', 'height', etc, etc] > self.settings = QSettings(foo, bar) > > tmp = [] > for field in FIELDS: > tmp.append( self.settings.value(field) ) > return tmp > > Panupat. > > -- > You received this message because you are subscribed to the Google Groups > "Python Programming for Autodesk Maya" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To post to this group, send email to [email protected]. > For more options, visit https://groups.google.com/groups/opt_out. > > > -- You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. For more options, visit https://groups.google.com/groups/opt_out.
