import os def save_raw_text(main_text, other_texts): # メインテキストとその他のテキストを改行で結合 combined_text = main_text + "\\n" + other_texts # 結合したテキストを output1.txt に保存 output1_path = os.path.join(os.path.dirname(__file__), "output1.txt") with open(output1_path, 'w', encoding='utf-8') as file: file.write(combined_text) return "" if __name__ == "__main__": import sys main_text = sys.argv[1] if len(sys.argv) > 1 else "" other_texts = sys.argv[2] if len(sys.argv) > 2 else "" output_text = save_raw_text(main_text, other_texts) print(output_text)