「file.write(repr(fieldNames1))」が「fieldNames1」に入力した内容を書き込むようにするにはどうすればよいですか?
import easygui
#Multi Enter Box
fieldNames1= ['Situation:(Example: Waiting for a friend who is late.)','Thoughts:(EXAMPLE: My friend Bob is always late!)','Emotions:(EXAMPLE: Mad & Stressed)','Behavior:(EXAMPLE: Arguing with family)']
#Write to file
file = open('Fieldnames test.txt', 'a')
file.write(repr(fieldNames1))
file.close()
「fieldnNames1」に入力した内容に関係なく、次のテキストを含む「Fieldnames test.txt」というファイルを作成します。
['状況:(例: 遅れてくる友達を待っている。)', '考え:(例: 友達のボブはいつも遅れる!)', '感情:(例: 怒ってストレスを感じている)', '行動:(例: 家族との口論)']