SyntaxError: multiple statements found while compiling a single statement

Cai Gengyang gengyangcai at gmail.com
Sat Oct 8 10:44:44 EDT 2016


Somehow it still doesnt work --- it keeps giving the syntaxerror, inconsistent use of tabs and indentation message EVEN though i use only the enter and space buttons and never touched the tab button a single time. Im pretty sure there is something wrong with the program itself. Gonna download pycharm and start testing the programs in it --- heard that it gives a better user experience with indentations




On Saturday, October 8, 2016 at 7:46:57 PM UTC+8, bream... at gmail.com wrote:
> On Saturday, October 8, 2016 at 12:07:47 PM UTC+1, Rustom Mody wrote:
> > On Saturday, October 8, 2016 at 1:21:50 PM UTC+5:30, Cai Gengyang wrote:
> > > This is the result when I copy and paste it one line at a time :
> > > 
> > > >>> rect_x = 50
> > > >>> rect_y = 50
> > > >>> while not done:									
> > >  for event in ...
> > <etc>
> > 
> > There's sure something strange about your formatting
> > 
> > you want something like this I think:
> > 
> > rect_x = 50
> > rect_y = 50
> > while not done:
> >     for event in pygame.event.get():
> >         if event.type == pygame.QUIT:
> >             done = True
> > 
> > On a related note in addition to Steven's 2 suggestions
> > - paste 1 line at a time
> > - Write the code in a py file
> > 
> > you could also try it out without Idle
> > ie start python at your shell (or terminal or cmd.exe or whatever)
> > And try it there
> 
> The easiest way is to use the ipython %paste magic command.
> 
> Kindest regards.
> 
> Mark Lawrence.




More information about the Python-list mailing list