中易网

python的问题....

答案:2  悬赏:70  
解决时间 2021-04-27 20:10
  • 提问者网友:江山如画
  • 2021-04-27 13:59
这是天堂2模拟器上的一个问题
其中有一段脚本如下
if string == "UC" :
playerLevel = player.getLevel()
if playerLevel < 6 and st.getInt("onlyone") == 0 :
uc = st.getInt("ucMemo")
# Announcements.getInstance().announceToAll("欢迎「"+player.getName()+"」登入了。")
if uc == 0 :
st.set("ucMemo","0")
st.startQuestTimer("QT",10000)
st.set("ucMemo","0")
st.set("Ex","-2")
elif uc == 1 :
st.showQuestionMark(1)
st.playTutorialVoice("tutorial_voice_006")
st.playSound("ItemSound.quest_tutorial")
elif uc == 2 :
if st.getInt("Ex") == 2 :
st.showQuestionMark(3)
st.playSound("ItemSound.quest_tutorial")
if st.getQuestItemsCount(6353) == 1 :
st.showQuestionMark(5)
st.playSound("ItemSound.quest_tutorial")
elif uc == 3 :
st.showQuestionMark(12)
st.playSound("ItemSound.quest_tutorial")
st.onTutorialClientEvent(0)
else :
return
else :
Announcements.getInstance().announceToAll("欢迎「"+player.getName()+"」登入了。")
return

但是这个脚本编译是无法通过的 错误信息如下
Traceback (innermost last):
(no code object) at line 0
SyntaxError: ('invalid syntax', ('__init__.py', 167, 21, '\t\t else :'))

求高手指点!非常感激

我下载了py2.6 缩进问题搞好了现在出现新的问题了
SyntaxError: ('Lexical error at line 167, column 83. Encountered: "\\u9286" (37510), after : ""', ('__init__.py', 167, 83, u' Announcements.getInstance().announceToAll("\u59DD\xA4\u7E4B\u9286?+player.getName()+"\u9286\u5D87\u6AE5\u934F\u30E4\u7C21\u9286?)'))
最佳答案
  • 二级知识专家网友:一起来看看吧
  • 2021-04-27 15:19
嗯,缩进问题
全部回答
  • 1楼网友:何必打扰
  • 2021-04-27 16:29

py安装包自带帮助文件。那可是好东西  在路径是   \python26\doc\里面的chm帮助文件就是  。唯一一个

我要举报
如以上回答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
点此我要举报以上问答信息!
大家都在看
推荐信息