Hi guys,

I'm working on my python script to get the list of elements in the arrays. I'm using the variable position_x = elem.getX() to get the list of pixel size for the elements.

Here is the output:

18:32:12 T:4060  NOTICE: 375
18:32:12 T:4060  NOTICE: 724
18:32:12 T:4060  NOTICE: 1073
18:32:12 T:4060  NOTICE: 1261
18:32:12 T:4060  NOTICE: 1449
18:32:12 T:4060  NOTICE: 1798
18:32:12 T:4060  NOTICE: 2147
18:32:12 T:4060  NOTICE: 2496
18:32:12 T:4060  NOTICE: 2845
18:32:12 T:4060  NOTICE: 3194
18:32:12 T:4060  NOTICE: 3543
18:32:12 T:4060  NOTICE: 4241
18:32:12 T:4060  NOTICE: 4590
18:32:12 T:4060  NOTICE: 4939
18:32:12 T:4060  NOTICE: 5289
18:32:12 T:4060  NOTICE: 5638
18:32:12 T:4060  NOTICE: 5987
18:32:12 T:4060  NOTICE: 6336
18:32:12 T:4060  NOTICE: 6685
18:32:12 T:4060  NOTICE: 7034
18:32:12 T:4060  NOTICE: 7383
18:32:12 T:4060  NOTICE: 7732
18:32:12 T:4060  NOTICE: 9456
18:32:12 T:4060  NOTICE: 10154
18:32:12 T:4060  NOTICE: 10503
18:32:12 T:4060  NOTICE: 10852
18:32:12 T:4060  NOTICE: 11201
18:32:12 T:4060  NOTICE: 11550
18:32:12 T:4060  NOTICE: 11900
18:32:12 T:4060  NOTICE: 12249
18:32:12 T:4060  NOTICE: 12598
18:32:12 T:4060  NOTICE: 12947
18:32:12 T:4060  NOTICE: 13296
18:32:12 T:4060  NOTICE: 13645
18:32:12 T:4060  NOTICE: 13994
18:32:12 T:4060  NOTICE: 14343
18:32:12 T:4060  NOTICE: 14692
18:32:12 T:4060  NOTICE: 15041
18:32:12 T:4060  NOTICE: 15390
18:32:12 T:4060  NOTICE: 15739
18:32:12 T:4060  NOTICE: 16088
18:32:12 T:4060  NOTICE: 16437
18:32:12 T:4060  NOTICE: 18161
18:32:12 T:4060  NOTICE: 18860
18:32:12 T:4060  NOTICE: 19209
18:32:12 T:4060  NOTICE: 19558
18:32:12 T:4060  NOTICE: 19907
18:32:12 T:4060  NOTICE: 20256
18:32:12 T:4060  NOTICE: 20605
18:32:12 T:4060  NOTICE: 20954
18:32:12 T:4060  NOTICE: 21652
18:32:12 T:4060  NOTICE: 22001
18:32:12 T:4060  NOTICE: 22350
18:32:12 T:4060  NOTICE: 22699
18:32:12 T:4060  NOTICE: 23048
18:32:12 T:4060  NOTICE: 23397
18:32:12 T:4060  NOTICE: 23746
18:32:12 T:4060  NOTICE: 24095
18:32:12 T:4060  NOTICE: 24444
18:32:12 T:4060  NOTICE: 24794
18:32:12 T:4060  NOTICE: 25143
18:32:12 T:4060  NOTICE: 26867
18:32:12 T:4060  NOTICE: 27565
18:32:12 T:4060  NOTICE: 27914
18:32:12 T:4060  NOTICE: 28263
18:32:12 T:4060  NOTICE: 28612
18:32:12 T:4060  NOTICE: 28961
18:32:12 T:4060  NOTICE: 29310
18:32:12 T:4060  NOTICE: 29659
18:32:12 T:4060  NOTICE: 375
18:32:12 T:4060  NOTICE: 1073
18:32:12 T:4060  NOTICE: 1261
18:32:12 T:4060  NOTICE: 1449
18:32:12 T:4060  NOTICE: 2147
18:32:12 T:4060  NOTICE: 3871
18:32:12 T:4060  NOTICE: 4220
18:32:12 T:4060  NOTICE: 4918
18:32:12 T:4060  NOTICE: 5616
18:32:12 T:4060  NOTICE: 5965
18:32:12 T:4060  NOTICE: 8374
18:32:12 T:4060  NOTICE: 8723
18:32:12 T:4060  NOTICE: 9072
18:32:12 T:4060  NOTICE: 9421
18:32:12 T:4060  NOTICE: 9770
18:32:12 T:4060  NOTICE: 10468
18:32:12 T:4060  NOTICE: 12192
18:32:12 T:4060  NOTICE: 13916
18:32:12 T:4060  NOTICE: 14614
18:32:12 T:4060  NOTICE: 14963
18:32:12 T:4060  NOTICE: 15661
18:32:12 T:4060  NOTICE: 16011
18:32:12 T:4060  NOTICE: 16709
18:32:12 T:4060  NOTICE: 17407
18:32:12 T:4060  NOTICE: 19473
18:32:12 T:4060  NOTICE: 19822
18:32:12 T:4060  NOTICE: 21546
18:32:12 T:4060  NOTICE: 22244
18:32:12 T:4060  NOTICE: 22593
18:32:12 T:4060  NOTICE: 23291
18:32:12 T:4060  NOTICE: 23989
18:32:12 T:4060  NOTICE: 24338
18:32:12 T:4060  NOTICE: 26747
18:32:12 T:4060  NOTICE: 27096
18:32:12 T:4060  NOTICE: 27445
18:32:12 T:4060  NOTICE: 27794
18:32:12 T:4060  NOTICE: 28143
18:32:12 T:4060  NOTICE: 28841
18:32:12 T:4060  NOTICE: 30565
18:32:12 T:4060  NOTICE: 32289
18:32:12 T:4060  NOTICE: 32987
18:32:12 T:4060  NOTICE: 33336
18:32:12 T:4060  NOTICE: 34035
18:32:12 T:4060  NOTICE: 34384
18:32:12 T:4060  NOTICE: 35082
18:32:12 T:4060  NOTICE: 35780
18:32:12 T:4060  NOTICE: 37504
18:32:12 T:4060  NOTICE: 37853
18:32:12 T:4060  NOTICE: 38202
18:32:12 T:4060  NOTICE: 38551
18:32:12 T:4060  NOTICE: 38900
18:32:12 T:4060  NOTICE: 39249
18:32:12 T:4060  NOTICE: 39598
18:32:12 T:4060  NOTICE: 39947
18:32:12 T:4060  NOTICE: 40296
18:32:12 T:4060  NOTICE: 40995
18:32:12 T:4060  NOTICE: 41693
18:32:12 T:4060  NOTICE: 42042
18:32:12 T:4060  NOTICE: 44450
18:32:12 T:4060  NOTICE: 44799
18:32:12 T:4060  NOTICE: 45148
18:32:12 T:4060  NOTICE: 45497
18:32:12 T:4060  NOTICE: 45846
18:32:12 T:4060  NOTICE: 46544
18:32:12 T:4060  NOTICE: 48268
18:32:12 T:4060  NOTICE: 49992
18:32:12 T:4060  NOTICE: 50691
18:32:12 T:4060  NOTICE: 51040
18:32:12 T:4060  NOTICE: 51738
18:32:12 T:4060  NOTICE: 375
...etc

I want the results to be like this:

375
375
375
375
375
375
375

Here is the code:

for elem in self.program_buttons:
    width = elem.getWidth()    #get width size
    position_x = elem.getX()    #Get positionX
    #print the list of result to be 375
    print position_x

Can you please tell me how I can use the variable position_x to find the element so i can print the list of elements with 375?

Perhaps you mean

if position_x == 375:
    print position_x

?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.