Python Forum
[xbmc] How to block the code from executed twice under the loop
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[xbmc] How to block the code from executed twice under the loop
#5
Here is the contain for self.program_id:

['3001', '3011', '3021', '3031', '3041', '3051', '3061']
Well I have to call
self.getControl(int(program_id))
so many times under the each if statement because I want to change the button size I want when I check the variable program_width at the same time I use to call the
self.getControl(int(program_id))
to find the id and get the width size I want to get.

I have putting the print inside the loop, it will print like 7 times as I have got 7 program ids that I stored in the self.program_id list. What do you expect me to do to put the print statements with the variables inside the loop?

I have put the print before the loop, it did not called more than one. I cant be able to use the statements before the loop because I need to use the program_id to get the program ids when I stored the list of ids in the self.program_id list.
Reply


Messages In This Thread
RE: How to block the code from executed twice under the loop - by chris0147 - Oct-25-2016, 12:05 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  [Tkinter] messagebox is not being executed please help erwinsiuda 2 2,341 Apr-02-2020, 01:56 AM
Last Post: Larz60+
  [Tkinter] Window unresponsive when executed. fawazcode 2 3,836 Sep-11-2017, 12:29 AM
Last Post: Larz60+
  [WxPython] Which def is executed? merlem 10 7,939 Feb-10-2017, 11:28 AM
Last Post: Yoriz

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020