下面的代码给我这个错误“令牌错误:多行语句中的EOF”。 这是什么错误?我该如何解决?
import easygui
import time
namegui = easygui.enterbox(msg='Enter your name:', title="Name query", default='Gian')
situationgui = easygui.enterbox(msg='Please enter your situation:', title="Thought Log(Situation)")
thoughtsgui = easygui.enterbox(msg='Please enter your thoughts:', title="Thought Log(Thoughts")
emotionsgui = easygui.enterbox(msg='Please enter your emotions: \n Sad, Mad, Hurt, Depressed, Anxious, Tense, etc.', title="Thought Log(Emotions")
behaviorgui = easygui.enterbox(msg='Please enter your behavior:', title="Thought Log(Behavior")
thinking_trapsgui = easygui.enterbox(msg='Please identify your thinking traps: \n \n'
'FORTUNE-TELLING: This occurs when we predict that things will turn out badly. However, we cannot predict the future because we do not have a magic ball! \n \n'
'MIND-READING: This happens when we believe that we know what others are thinking and we assume that they are thinking the worst of us. However, we cannot mind-read so we do not know what others are thinking! \n \n'
'LABELING: Sometimes we talk to ourselves in a mean way and we use a single negative word to describe ourselves. However, this kind of thinking is unfair and we are too complex to be summed up in a single word! \n \n'
'FILTERING: This happens when we take note of all the bad things that happen, but ignore any good things. \n \n'
'OVERESTIMATING: This happens when we believe that something that is unlikely to occur is actually about to happen. \n \n'
'CATASTROPHIZING: This is when we imagine the worst possible thing is about to happen and we will be unable to cope with it. \n \n'
'OVERGENERALIZING: This is when we use words like always or never to describe situations or events. This is a problematic way of thinking because it does not take all situation or events into account \n \n',
title="Thought Log(Identify Your Thinking Traps)")
BAI_var = easygui.choicebox(
msg='Please identify your thinking traps: \n \n',
title="Thought Log(Identify Your Thinking Traps)",
choices=('FORTUNE-TELLING: This occurs when we predict that things will turn out badly. However, we cannot predict the future because we do not have a magic ball! \n \n
'MIND-READING: This happens when we believe that we know what others are thinking and we assume that they are thinking the worst of us. However, we cannot mind-read so we do not know what others are thinking! \n \n'
'LABELING: Sometimes we talk to ourselves in a mean way and we use a single negative word to describe ourselves. However, this kind of thinking is unfair and we are too complex to be summed up in a single word! \n \n'
'FILTERING: This happens when we take note of all the bad things that happen, but ignore any good things. \n \n'
'OVERESTIMATING: This happens when we believe that something that is unlikely to occur is actually about to happen. \n \n'
'CATASTROPHIZING: This is when we imagine the worst possible thing is about to happen and we will be unable to cope with it. \n \n'
'OVERGENERALIZING: This is when we use words like always or never to describe situations or events. This is a problematic way of thinking because it does not take all situation or events into account \n \n')
alt_behaviorgui = easygui.enterbox(msg='Please enter alternative behavior:', title="Thought Log(Alt Behavior)")
alt_thoughtsgui = easygui.enterbox(msg='Please enter alternative thoughts:', title="Thought Log(Alt Thoughts)")
yeargui = easygui.enterbox(msg='Enter the current year:', title="Current Year", default='2011')
monthgui = easygui.enterbox(msg='Enter the current month:', title="Current Month")
daygui = easygui.enterbox(msg='Enter the current day:', title="Current Day")
time_hourgui = easygui.enterbox(msg='Enter the current hour:', title="Current Hour")
time_minutegui = easygui.enterbox(msg='Please enter current minutes:', title="Current Minute")
am_pmgui = easygui.enterbox(msg='Please enter either am or pm:', title="AM OR PM")
file = open('Thought Record 1.0.txt', 'a')
file.write(namegui + '\n')
file.write(daygui)
file.write('/')
file.write(monthgui)
file.write('/')
file.write(yeargui)
file.write('\n')
file.write('Your situation:')
file.write(situationgui)
file.write('\n')
file.write('Your thoughts:')
file.write(thoughtsgui)
file.write('\n')
file.write('Your emotions:')
file.write(emotionsgui)
file.write('\n')
file.write('Your behavior:')
file.write(behaviorgui)
file.write('\n')
file.write('Thinking traps:')
file.write(thinking_trapsgui)
file.write('\n')
file.write('Alternative bahvior:')
file.write(alt_behaviorgui)
file.write('\n')
file.write('Alternative thoughts:')
file.write(alt_thoughtsgui)
file.write('\n')
file.write('\n')
file.close()
只有在添加以下代码行后,才会出现此错误。
BAI_var = easygui.choicebox(
msg='Please identify your thinking traps: \n \n',
title="Thought Log(Identify Your Thinking Traps)",
choices=('FORTUNE-TELLING: This occurs when we predict that things will turn out badly. However, we cannot predict the future because we do not have a magic ball! \n \n
'MIND-READING: This happens when we believe that we know what others are thinking and we assume that they are thinking the worst of us. However, we cannot mind-read so we do not know what others are thinking! \n \n'
'LABELING: Sometimes we talk to ourselves in a mean way and we use a single negative word to describe ourselves. However, this kind of thinking is unfair and we are too complex to be summed up in a single word! \n \n'
'FILTERING: This happens when we take note of all the bad things that happen, but ignore any good things. \n \n'
'OVERESTIMATING: This happens when we believe that something that is unlikely to occur is actually about to happen. \n \n'
'CATASTROPHIZING: This is when we imagine the worst possible thing is about to happen and we will be unable to cope with it. \n \n'
'OVERGENERALIZING: This is when we use words like always or never to describe situations or events. This is a problematic way of thinking because it does not take all situation or events into account \n \n')
我在Mac OS X 10.6上运行Python 2.5
您的choices变量的第一行'
末尾没有撇号()。
在My Gulpfile.js错误部分: 我的包裹。json: 我运行并得到以下错误。 在终端屏幕中: gulp.task('webpack',gulp.series(async()=
所以我在第37行的else if中出现了错误,我不知道为什么会发生这种情况。IDE说:“令牌”else“语法错误,删除这个令牌”。多谢了。
谢谢!!
我正在做一个java自动售货机操作系统,我刚刚将我的原始项目导入到eclipse中,并添加了一个guy页面,从那以后,无论我做什么,它到处都是错误,我能得到一些帮助吗?现在的主要错误是“令牌的语法错误,错误的构造”,如果代码是坏的或者是低效率的,我会提前道歉。
问题内容: 这是我的代码一直在给问题。 我不知道为什么要这么做。 编辑: 我已根据您的要求进行了编辑,以查看更多代码。 问题答案: 您要在课程外声明一个字段: 它必须放在一个类中:
问题内容: 创建新类时遇到了此类错误。下面是我的代码: 谁能帮助我弄清楚实际发生了什么,并提出解决建议?非常感谢您的帮助 真诚的 问题答案: 该声明 应该在代码块中,例如方法,构造函数或实例初始化程序中,而不是在类块中
我不知道该怎么做,是不是有一个错误,我遵循了所有的步骤,在教程中,我正在看。它只是说删除令牌
问题内容: 我正在使用Python执行单线循环,即: 这很好。但是,如果我在for循环之前导入模块,则会收到语法错误: 任何想法如何解决? 对我来说,将其作为一个单行放置非常重要,这样我才能将其包含在Makefile中。 问题答案: 你可以做 或不带管道: 要么 或@ SilentGhost的答案 只需使用return并在下一行输入它: