Code: Alles auswählen
83,80,80,80,80,81,81,81,81,81,81,82,82,82,82,82,82,83,83,83,83,83,80,80,80,80,80,80,80,83,66,66,66,66,66,66
66,66,66,83,80,80,80,80,81,81,81,81,81,81,82,82,82,82,82,82,83,83,83,83,83,80,80,80,80,80,80,80,83,66,66,66
66,66,66,66,66,66,83,80,80,80,80,81,81,81,81,81,81,82,82,82,82,82,82,83,83,83,83,83,80,80,80,80,80,80,80,83
66,66,66,83,80,80,80,80,81,81,81,81,81,81,82,82,82,82,82,82,83,83,83,83,83,80,80,80,80,80,80,80,80,80,80,83
83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83
65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65
83,80,80,80,80,81,81,81,81,81,81,82,82,82,82,82,82,83,83,83,83,83,66,66,66,66,66,66,66,66,66,66,66,66,66,66
83,83,83,65,65,65,83,80,80,80,80,81,81,81,81,81,81,82,82,82,82,82,82,83,83,83,83,83,80,80,80,80,80,80,80,83
83,83,65,83,80,80,80,80,81,81,81,81,81,81,82,82,82,82,82,82,83,83,83,83,83,80,80,80,80,80,80,80,83,65,83,83
68,77,88,89,88,88,88,89,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66
68,77,88,89,88,88,88,89,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66
97,97,97,97,97,97,97,97,97,97,97,86,82,69,91,85,85,88,91,72,91,93,91,97,97,97,97,97,95,91,77,69,77,95,95,93
79,79,79,79,79,79,79,79,79,79,79,79,79,79,79,79,79,79,79,79,79,79,79,79,79,79,79,79,79,79,79,79,79,79,79,79
Code: Alles auswählen
import sys
inputFile = open(sys.argv[1], 'r')
def findBiggestLength(integ):
i = 0
startPosFound = False
startPos = 0
endPos = 0
biggestSeqLength = 0
limit = 79
minLen = 30
length = len(integ)
while i < length:
if (integ[i] >= limit) and (startPosFound == False):
startPos = i
startPosFound = True
elif (integ[i] < limit):
startPosFound = False
biggestSeqLength = i - startPos + 1
if biggestSeqLength >= minLen:
endPos = i - 1
i += 1
return (startPos, endPos+1)
for line in inputFile:
line = line.rstrip()
line = line.split(",")
(startPos, endPos) = findBiggestLength(line)
print line[startPos:endPos]
Was mache ich falsch?
Viele Gruesse