0
我一直在谷歌搜索,我找不到解決方案。請有人分享一個工作的例子嗎?如何定義名稱'feildNames1'?
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('Log.txt', 'a')
file.write(feildNames1)
file.close()
這是我與掙扎的錯誤:
file.write(repr(feildNames1)) NameError: name 'feildNames1' is not defined