Hi folks,
I have the following loop (actually repeated many times )
def locChoices(self):
locDS = self.eslocation.getDataSet()
loc_Choices=['']
locKeys=[0]
for row in locDS:
loc_Choices.append(row['facility'])
locKeys.append(row['pkid'])
johnf wrote:
> Hi folks,
>
>
> I have the following loop (actually repeated many times )
If you have repetetive code look into ways to parameterize it, like
def choices(rows, choices_column, keys_column):
...
>
> def locChoices(self):
> locDS = self.eslocation.getDataSet()
> loc_Choice
On 6/24/19 10:15 AM, johnf wrote:
.
>
> Since I use a lot of similar loops to populate many dropdown controls I
> started investigating the use of list comprehensions. But I can't
> figure out how to use them in this loop and wonder if it will improve
> the performance.
To amplify a tiny bit on
Actually I do not see a reply from Peter?? I don't have a clue what
was said.
I realize that performance is not a big issue in this case - of course
an increase in speed is always welcome. I was more interested in a
better understanding of the list comprehensions. Since I have so many
Hi John,
On 25/06/19 4:15 AM, johnf wrote:
Hi folks,
I have the following loop (actually repeated many times )
def locChoices(self):
locDS = self.eslocation.getDataSet()
loc_Choices=['']
locKeys=[0]
for row in locDS:
loc_Choices.append(row['facil
Thank you - it worked! I'm glad you are no longer sleepy!
Actually I wanted the naming to remain consistent with the other loops
So the name of the function/method (it is in a class) caused the use of
the underscore
locChoices == location choices
def locChoices(self) cause me to use loc_Cho
On 6/24/19 4:24 PM, johnf wrote:
> Thank you - it worked! I'm glad you are no longer sleepy!
>
> Actually I wanted the naming to remain consistent with the other loops
>
> So the name of the function/method (it is in a class) caused the use of
> the underscore
>
> locChoices == location choices
On 24/06/2019 17:15, johnf wrote:
> def locChoices(self):
> locDS = self.eslocation.getDataSet()
> loc_Choices=['']
> locKeys=[0]
> for row in locDS:
> loc_Choices.append(row['facility'])
> locKeys.append(row['pkid'])
>
> retu