Skip to content
Permalink
4d5c2d4827
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
62 lines (59 sloc) 2.19 KB
import xlrd #exel library
from GeneralInput import inputFunction
from GeneralInputAnalysis import inputBreakdown
from GeneralOutput import outputFuncktion
def informationRetrieval (infoList):
loc = ("pokemonSpreadyeet.xlsx")
wb = xlrd.open_workbook(loc)
sheet = wb.sheet_by_index(0)
if infoList[-1]==True:
wordList=infoList[-1]
word=wordList[-1]
word=word.capitalize()
wordList[-1]=word
print("sds")
Pokemon=[]
pokeNumber=0
reqNumber=infoList[6]
typeRequest=infoList[5]
for i in range(sheet.nrows):
if infoList[-1]==True:
if sheet.cell_value(i, 1)==wordList[-1]:
pokeNumber=i
if infoList[2]==True:
if bool(infoList[5])==True:
for i in range(sheet.nrows):
if reqNumber==0:
break
if sheet.cell_value(i, 2)==typeRequest[0]:
Pokemon=Pokemon+[sheet.cell_value(i, 1)]
reqNumber=reqNumber-1
if reqNumber==0:
break
if sheet.cell_value(i, 3)==typeRequest[0]:
Pokemon=Pokemon+[sheet.cell_value(i, 1)]
reqNumber=reqNumber-1
if infoList[3]==True:
if bool(infoList[5])==True:
for i in range(sheet.nrows):
if reqNumber==0:
break
if sheet.cell_value(-i, 2)==typeRequest[0]:
Pokemon=Pokemon+[str(sheet.cell_value(-i, 1))]
reqNumber=reqNumber-1
if reqNumber==0:
break
if sheet.cell_value(-i, 3)==typeRequest[0]:
Pokemon=Pokemon+[str(sheet.cell_value(-i, 1))]
reqNumber=reqNumber-1
if pokeNumber>0:
returnList=str(pokeNumber)
else :
returnList=Pokemon
return returnList
grandInputList=inputFunction()
inputList=grandInputList[0]
infoList=inputBreakdown(inputList)
extrainfo=infoList[1]
infoList=informationRetrieval(infoList[0])
outputFuncktion(infoList,grandInputList[1],extrainfo)