So is it a compiler or interpreter? // Naderan *Mahmood;
________________________________ From: Burton Samograd <bur...@userful.com> To: python-list@python.org Sent: Fri, July 30, 2010 10:36:56 PM Subject: Re: how python works Mahmood Naderan <nt_mahm...@yahoo.com> writes: > I want to know how python executes a .py file. Sometimes when I run a > file, I get an error that there is a syntax error. This shows that the > parser read and parse the whole file. Sometimes in the middle of the > run I get an error that another line has problem. So how does it work? > if it doesn't compile and read line by line them why some times I get > error just before run? Python first complies the file, which will find any syntax errors that you have in your code. If there are any, then it will stop there before executing the resulting compiled code. If the compilation is successful, it will then run the code, where you might have run-time errors, which are code with a proper syntax but errors during execution. -- Burton Samograd -- http://mail.python.org/mailman/listinfo/python-list
-- http://mail.python.org/mailman/listinfo/python-list