[Tutor] help with existing code

Brianna McGee brianna.mcgee2 at gmail.com
Wed Jan 6 17:57:26 EST 2016


I am a new to programming and have started out with modifying existing code
to suit my purposes in my Developmental Psychology lab. The script worked
fine previous to my fiddling with it, but now that I am trying to modify
the x and y locations based upon a text file with existing x and y
locations it will run but won't create the jpegs. I've attached an example
of the text file. HELP! Please let me know if you need to see the rest of
the code.

 if setsize == 4:

                locations = open('X_Y_locations_SS4.txt', 'r')

                i = 0;
                for line in locations:
                    i = i+1;

                    if i % 2 != 0:

                        pointArray = line.split(",", 8);
                        x1 = int(pointArray[0]);
                        y1 = int(pointArray[1]);
                        x2 = int(pointArray[2]);
                        y2 = int(pointArray[3]);
                        x3 = int(pointArray[4]);
                        y3 = int(pointArray[5]);
                        x4 = int(pointArray[6]);
                        y4 = int(pointArray[7]);

   Thank you in advance!
-------------- next part --------------
1454,657,530,794,410,464,1130,289,
111,107,820,512,634,671,693,577,
140,676,1463,868,90,312,403,602,
1088,963,817,542,147,300,565,561,
1471,595,1150,861,1085,979,101,110,
1395,334,402,209,893,146,407,196,
1153,626,575,287,1079,759,1230,791,
1236,759,157,645,1026,558,701,240,
1407,213,81,723,249,256,1476,456,
897,712,270,578,1565,474,1133,459,
1398,151,533,679,1546,788,672,922,
1101,450,815,336,996,473,960,121,
604,770,927,685,1338,194,1362,700,
880,145,1106,605,1250,500,456,803,
577,338,164,617,1027,886,679,233,
1559,381,1026,918,1552,698,967,608,
566,737,1061,330,1432,473,1440,725,
495,715,806,870,1075,517,1050,89,
1582,722,1033,83,510,503,595,245,
1156,544,915,699,630,383,725,847,
809,752,553,159,568,804,527,550,
1162,667,615,528,180,891,165,653,
304,553,517,909,1290,303,533,293,
250,450,1444,166,527,413,314,888,
231,852,696,533,842,139,1128,121,


More information about the Tutor mailing list