diff --git a/images2text.py b/images2text.py index 0328eff..98142dc 100755 --- a/images2text.py +++ b/images2text.py @@ -75,9 +75,14 @@ def main(directory_path): # Filter out any None values and write the text to final.txt final_text = [text for text in final_text if text is not None] - with open("final.txt", 'w') as f: + FINAL_OUTPUT = "final.txt" + with open(FINAL_OUTPUT, 'w') as f: f.write("\n".join(final_text)) + print(f"All images processed! Final output saved to {FINAL_OUTPUT}") + return FINAL_OUTPUT # Add this line + + if __name__ == "__main__": if len(sys.argv) != 2: print("Usage: python images2text.py ") diff --git a/text2csvdeck.py b/text2csvdeck.py index 29d68ea..876bb70 100644 --- a/text2csvdeck.py +++ b/text2csvdeck.py @@ -47,7 +47,7 @@ def create_csv_deck(text_file_path): # Extract CSV content from response and save to a new file csv_content = response.choices[0]['message']['content'] - output_filename = text_file_path.replace(".txt", "_deck.csv") + output_filename = "output_deck.csv" with open(output_filename, 'w') as csv_file: csv_file.write(csv_content)