Added a few more example usages.

This commit is contained in:
2018-02-28 22:30:14 -05:00
parent e05dee87a8
commit a278b7dc72
2 changed files with 34 additions and 0 deletions

View File

@ -0,0 +1,20 @@
import scrython
import time
query = input("Name a card: ")
auto = ""
try:
time.sleep(0.05)
card = scrython.cards.Named(exact=query)
except Exception:
time.sleep(0.05)
auto = scrython.cards.Autocomplete(q=query, query=query)
if auto:
print("Did you mean?")
for item in auto.data():
print(item)
else:
print(card.name())

View File

@ -0,0 +1,14 @@
import scrython
import time
query = input("Type the name of the set: ")
time.sleep(0.05)
sets = scrython.sets.Sets()
for i in range(sets.data_length()):
if sets.set_name(i) == query:
print("Set code:", sets.set_code(i).upper())
break
else:
continue