Hi guys,
I'm created the variables in the loops to generating the list of values and channels, I want to use the variable outside of the loop so I can get the list of values. I have a problem with get the list of values.
When I try this:
# set the channels text
for index in range(0, CHANNELS_PER_PAGE):
channel = channelList[index]
channel_index = index
for channels_id in range(4127, 4548, 70):
ID = []
if channel is not None:
ID = channels_id
print ID
print channel
self.getControl(ID).setLabel(channel)
I will get the output like this:
01:59:10 T:6768 NOTICE: 4547
01:59:10 T:6768 NOTICE: 4547
01:59:10 T:6768 NOTICE: 4547
01:59:10 T:6768 NOTICE: 4547
01:59:10 T:6768 NOTICE: 4547
01:59:10 T:6768 NOTICE: 4547
01:59:10 T:6768 NOTICE: 4547
It should be like this:
01:59:10 T:6768 NOTICE: 4127
01:59:10 T:6768 NOTICE: 4197
01:59:10 T:6768 NOTICE: 4267
01:59:10 T:6768 NOTICE: 4337
01:59:10 T:6768 NOTICE: 4407
01:59:10 T:6768 NOTICE: 4477
01:59:10 T:6768 NOTICE: 4547
The problem are lie in this code:
for channels_id in range(4127, 4548, 70):
ID = []
if channel is not None:
ID = channels_id
print ID
I'm stored the variable ID
under the loop called for channels_id
to generating the list of values. I want to use that variable outside of the loop so I can use the getControl method to get the list of values while I can use the other variable channel
to get the list of channels.
Can you please show me how I can use the variable ID
outside of the loop where I can use with the other variable channel
so I can use it on getControl method?