From 7e1f509d0b80f5f1dcb7ad7fa4ddf34848438ad7 Mon Sep 17 00:00:00 2001 From: Oliver <120502505+opott@users.noreply.github.com> Date: Wed, 10 Apr 2024 15:59:11 +0000 Subject: [PATCH] feat: fetch name of set --- src/main.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main.py b/src/main.py index f33d905..854420a 100644 --- a/src/main.py +++ b/src/main.py @@ -1,5 +1,6 @@ # Importing necessary libraries from pokemontcgsdk import Card +from pokemontcgsdk import Set import subprocess import shlex @@ -18,6 +19,8 @@ def get_card_info(setname, card_number): def main(): # Get the deck id from the user setname = input("Enter deck id \n> ") + # Get the set name using the deck id + setname_full = Set.find(setname).name cards = [] print("Enter card numbers one by one and press enter. Type done when finished.") @@ -40,7 +43,7 @@ def main(): # Write the cards info to a text file with open('PikaPrint_Output.txt', 'w+') as f: - f.writelines("Set: " + setname + "\n" + "\n".join(cards)) + f.writelines("Set: " + setname_full + "\n" + "\n".join(cards)) print("Would you like to send the file to your default printer? (y/n)") # Print the text file if the user types 'y'