Hi all,
I'm just starting my way into Python and I'm trying to use a while loop with lists but keep getting the list index out of range error.
(Please ignore any other foolish mistakes I might find later on J):
Thanks in advance,
Einat
I'm just starting my way into Python and I'm trying to use a while loop with lists but keep getting the list index out of range error.
(Please ignore any other foolish mistakes I might find later on J):
Code:
DBReportsArray = [6000,5000,4000,3000,2000,1000,100]
curNum = 0
RepInDB = tssh.command ("ls -l /something | wc -l")[0] ##something to get a result by ssh
RepInDB = [y.replace("\n","") for y in RepInDB] ##replaces a non-good format
RepInDB = RepInDB[0]
print RepInDB ##I got 351
print self.DBReportsArray[curNum]
while self.DBReportsArray[curNum] <= RepInDB:
curNum+=1
RepToChange = RepInDB-self.DBReportsArray[self.curNum]
print RepToChange
Einat
Comment