Re: SyntaxError: multiple statements found while compiling a single statement

2022-08-07 Thread Joe Pfeiffer
Sohail Ahmad writes: > kindly please help me about issues > SyntaxError: multiple statements found while compiling a single statement > how to solve this issues Please post the code that got the error. Preferably several lines before the actual error, and the line with the error itself. -- h

Re: SyntaxError: multiple statements found while compiling a single statement

2017-09-24 Thread khushi27gkcse
On Saturday, October 8, 2016 at 11:32:17 AM UTC+5:30, Cai Gengyang wrote: > Any idea how to correct this error ? Looks fine to me > > >>> rect_x = 50 > > # Main Program Loop --- > while not done: > for event in pygame.event.get(): # User did something > if event

Re: SyntaxError: multiple statements found while compiling a single statement

2016-10-08 Thread Rustom Mody
On Sunday, October 9, 2016 at 12:12:06 PM UTC+5:30, Steve D'Aprano wrote: > On Sun, 9 Oct 2016 02:51 pm, Cai Gengyang wrote: > > > I defined both done and pygame in this piece of code, but now i get a new > > error that i have never seen before, an AttributeError > > AttributeError usually means

Re: SyntaxError: multiple statements found while compiling a single statement

2016-10-08 Thread Steve D'Aprano
On Sun, 9 Oct 2016 02:51 pm, Cai Gengyang wrote: > I defined both done and pygame in this piece of code, but now i get a new > error that i have never seen before, an AttributeError AttributeError usually means you have the wrong kind of object: py> mylist = {} # oops, a dict not a list py> myl

Re: SyntaxError: multiple statements found while compiling a single statement

2016-10-08 Thread Terry Reedy
On 10/8/2016 11:51 PM, Cai Gengyang wrote: pygame = True while not done: for event in pygame.event.get(): Traceback (most recent call last): File "", line 2, in for event in pygame.event.get(): AttributeError: 'bool' object has no attribute 'event' pygame == True and True ha

Re: SyntaxError: multiple statements found while compiling a single statement

2016-10-08 Thread Cai Gengyang
I defined both done and pygame in this piece of code, but now i get a new error that i have never seen before, an AttributeError >>> rect_x = 50 >>> rect_y = 50 >>> done = False >>> pygame = True >>> while not done: for event in pygame.event.get(): if event.type == pygame.QUI

Re: SyntaxError: multiple statements found while compiling a single statement

2016-10-08 Thread Steve D'Aprano
On Sun, 9 Oct 2016 01:51 pm, Cai Gengyang wrote: > This is my latest result : I copy and pasted one line at a time into the > IDLE and used ONLY the "enter-return" button to move on to the next line > and this time I didnt get an indentation error but instead a traceback > error: > Traceback (mos

Re: SyntaxError: multiple statements found while compiling a single statement

2016-10-08 Thread Cai Gengyang
This is my latest result : I copy and pasted one line at a time into the IDLE and used ONLY the "enter-return" button to move on to the next line and this time I didnt get an indentation error but instead a traceback error >>> rect_x = 50 >>> rect_y = 50 >>> while not done: for event in

Re: SyntaxError: multiple statements found while compiling a single statement

2016-10-08 Thread Gregory Ewing
Cai Gengyang wrote: 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. There was another thread about this a short time ago. It turn

Re: SyntaxError: multiple statements found while compiling a single statement

2016-10-08 Thread Terry Reedy
On 10/8/2016 2:56 AM, Steve D'Aprano wrote: Just copy and paste it into your Python IDLE and let me know what you get I don't normally use IDLE, and you shouldn't assume that everyone does. *That* is the extra information we need to solve the problem: The IDLE interactive interpreter in Pyth

Re: SyntaxError: multiple statements found while compiling a single statement

2016-10-08 Thread breamoreboy
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:

Re: SyntaxError: multiple statements found while compiling a single statement

2016-10-08 Thread Cai Gengyang
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 py

Re: SyntaxError: multiple statements found while compiling a single statement

2016-10-08 Thread Rustom Mody
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 ... Th

Re: SyntaxError: multiple statements found while compiling a single statement

2016-10-08 Thread Cai Gengyang
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 pygame.event.get():

Re: SyntaxError: multiple statements found while compiling a single statement

2016-10-08 Thread Steve D'Aprano
On Sat, 8 Oct 2016 05:29 pm, Cai Gengyang wrote: > Unfortunately, in this case, it is 100% of the information I am giving > you. Exactly. That's the problem. You need to give us more information, like how you are trying to run this code. Are you using an IDE? Which IDE? > You can try it yourse

Re: SyntaxError: multiple statements found while compiling a single statement

2016-10-07 Thread Cai Gengyang
Unfortunately, in this case, it is 100% of the information I am giving you. You can try it yourself. The code is in the first section (8.1) of http://programarcadegames.com/index.php?chapter=introduction_to_animation&lang=en#section_8 Just copy and paste it into your Python IDLE and let me know

Re: SyntaxError: multiple statements found while compiling a single statement

2016-10-07 Thread Steve D'Aprano
On Sat, 8 Oct 2016 05:02 pm, Cai Gengyang wrote: > Any idea how to correct this error ? Looks fine to me As usual, the first and most important rule of debugging is to use ALL the information the compiler gives you. Where is the rest of the traceback? At the very least, even if nothing else,