我一直在谷歌搜索,我找不到解决方案。有人可以分享一个工作示例吗?
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