-
Notifications
You must be signed in to change notification settings - Fork 0
/
Find_Card.py
25 lines (20 loc) · 867 Bytes
/
Find_Card.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
from path import SheetNames, File
from CellFormulas import find_cardLocation, getInput
hash_table = {}
def find_card(codeORname):
Card = ""
searchType = ""
#initialize with empty strings then assign respective values to eliminate extra for loop
if (codeORname == "N"):
Card = getInput("Enter the name of the card you wish to find: ") # Search result is Case sensitive
searchType = "name"
if (codeORname == "C"):
Card = getInput("Enter the code of the card you wish to find: ") # Search result is Case sensitive
searchType = "code"
for sheet in SheetNames:
currentSheet = DisplayCurrentSheet(sheet)
find_cardLocation(currentSheet, Card, searchType, hash_table)
def DisplayCurrentSheet(sheet):
print(f"\nCurrent sheet is: {sheet}\n")
currentSheet = File[sheet]
return currentSheet