how python works

Mahmood Naderan nt_mahmood at yahoo.com
Fri Jul 30 14:16:53 EDT 2010


So is it a compiler or interpreter?
 
// Naderan *Mahmood;




________________________________
From: Burton Samograd <burton at userful.com>
To: python-list at python.org
Sent: Fri, July 30, 2010 10:36:56 PM
Subject: Re: how python works

Mahmood Naderan <nt_mahmood at 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



      
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20100730/303a181c/attachment.html>


More information about the Python-list mailing list