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 err

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

2017-09-24 Thread khushi27gkcse
ser did something > if event.type == pygame.QUIT: # If user clicked close > done = True # Flag that we are done so we exit this loop > > SyntaxError: multiple statements found while compiling a single statement > > Thanks ... -- https://mail.python.org/mailman/listinfo/python-list

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
55, 255) SyntaxError: multiple statements found while compiling a single statement Here you pasted multiple *statements* (on separate lines). This is a known difference between console and IDLE Shell. It is partly related to being line versus statement oriented, partly due to window past

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
t; 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 Python 3 does not seem to allow you to > paste multiple lines at once. If you do, it highlights

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

2016-10-08 Thread Steve D'Aprano
Define some colors BLACK = (0, 0, 0) WHITE = (255, 255, 255) GREEN = (0, 255, 0) RED = (255, 0, 0) SyntaxError: multiple statements found while compiling a single statement >>> I can't show the colour highlighting, but the line BLACK = ... is highlighted in red. You can ei

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

2016-10-07 Thread Cai Gengyang
> The only way I can reproduce the error message you give is by using the > compile() function: > > py> compile("a=1\nb=2", "", "single") > Traceback (most recent call last): > File "", line 1, in > File "", line 1 > a

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

2016-10-07 Thread Steve D'Aprano
re code that you haven't shown us, and that the error is there. The only way I can reproduce the error message you give is by using the compile() function: py> compile("a=1\nb=2", "", "single") Traceback (most recent call last): File "", line 1, i

SyntaxError: multiple statements found while compiling a single statement

2016-10-07 Thread Cai Gengyang
at we are done so we exit this loop SyntaxError: multiple statements found while compiling a single statement Thanks ... -- https://mail.python.org/mailman/listinfo/python-list