I'm working on my python script to count on each value that start from 0
to count it to 17
.
Here is what I use:
row = range(0, 18)
print row
Result:
19:39:14 T:5816 NOTICE: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17]
I want to make the result like this:
>>> 0
>>> 1
>>> 2
>>> 3
>>> 4
>>> 5
>>> 6
>>> 7
>>> 8
>>> 9
>>> 10
>>> 11
>>> 12
>>> 13
>>> 14
>>> 15
>>> 16
>>> 17
Can you please tell me how I can split the values from the array to allow me to print each value like what I have show on above?
EDIT: You can see why I don't want to use the for loop, is because I want to generate the ids to use the variable outside the for loop and I want to get the list of elements from the arrays so I can store in a database. Otherwise it will be firing thousands of times.
#generating the program button ids
for generate_ids in range(3002, 3485):
program_id.append(generate_ids)
#create the rows to count for the 69 program buttons
row = range(0, 484)
row += row
print row
#program_id[row]
for elem in programs_button:
program_width.append(elem.getWidth())
#store the buttons in the database
#cur.execute("INSERT INTO buttons(button_ids, button_width)" + " VALUES(?, ?)", [program_id, program_width])