Reputation: 0 Apprentice
- Active Posts:
- 34 (0.02 per day)
- 21-October 09
- Profile Views:
- Last Active:
- Aug 07 2014 06:37 PM
- OS Preference:
- Favorite Browser:
- Favorite Processor:
- Favorite Gaming Platform:
- Your Car:
- Who Cares
- Dream Kudos:
Posts I've Made
Posted 7 Aug 2014Yes, but the value of 'nextcolumn' doesn't change within this inner loop - and it shouldn't either as it is controlling the main (outer) loop.
Oh wow thanks for the tip, it worked. I got the older code to work by catching the exception and proceeding anyway:
try: wb.save("instance"+str(nextcolumn)+'.xls') except Exception: pass
Which is just dumb. Thanks again.
Posted 7 Aug 2014I cannot be certain that this is the main issue, but:
for s in columnB: wb.save("instance"+str(nextcolumn)+'.xls')
you are over-writing the same file (.xls) a number of times in a loop. You only need to save this file once, outside this loop.
No, i'm trying to create several files, one for each loop. As the loop goes through the column it adds to the 'nextcolumn' variable. So the files in the directory for 3 columns in readme would be instance0.xlsx,instance1.xlsx,instance2.xlsx
Posted 1 Feb 2014[quote name='jon.kiparsky' date='01 February 2014 - 12:31 AM' timestamp='1391239876' post='1966019']
return callme(arry, left, right++);
Another nice catch. Fixed it. I'm still getting "Exception in thread "main" java.lang.StackOverflowError".
Posted 1 Feb 2014
Hmm. I definitely made a mistake on that one. Left was initially suppose to be 0 and right was suppose to be the end of the array. So it was returning me my array unsorted because right was already greater than left on the first call.
if(left>=right)but now i'm getting a "Exception in thread "main" java.lang.StackOverflowError". We're getting close.
Posted 31 Jan 2014I'll try to explain it as best as i can. The "left" variable starts at index 0 and the right variable starts at the end of the index. They are then bothide compared, if left is an odd number and right is an even number then they swap values. If left turns out to be an even number then no swap takes place and it points at the next index in the array. If right turns out to be an odd number then no swap takes place and it points at the next index in the array. It does this until all the even numbers are on the right sof the array.
- Member Title:
- New D.I.C Head
- Age Unknown
- Birthday Unknown
- Website URL:
helpme18 hasn't added any friends yet.