0

私はグーグルをしていて、解決策を見つけることができません。誰かが実際の例を共有していただけませんか?

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
4

1 に答える 1

3

スペルミスです。

変数を設定していfieldNames1ますが、を呼び出しrepr()ていfeildNames1ます。eとの配置に注意してくださいi

于 2011-11-03T05:49:46.040 に答える