SyntaxError: multiple statements found while compiling a single statement python

耗尽温柔 提交于 2019-11-30 10:01:41

问题


this is my code, super simple:

#borders of the bbox
longmax = 15.418483 #longitude top right
longmin = 4.953142 #longitude top left
latmax = 54.869808 #latitude top 
latmin = 47.236219 #latitude bottom

#longitude
longstep = longmax - longmin 
longstepx = longstep / 1000 #longitudal steps the model shall perfom


#latitude
latstep = latmax - longmin
latstepx = latstep / 1000 #latitudal steps the model shall perform

I try to run in it in the Python IDLE (python 3.3) and this errormessage occurs

SyntaxError: multiple statements found while compiling a single statement

Removing the "#" it works just fine.

Whats wrong?!


回答1:


IDLE can only do a single statement at once, i.e. in your case: A single line. So you have to paste in all lines individually and execute them.



来源:https://stackoverflow.com/questions/24588956/syntaxerror-multiple-statements-found-while-compiling-a-single-statement-python

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!