Program, Application, and Software

Martin Gregorie martin at address-in-sig.invalid
Thu Nov 18 19:57:42 EST 2010


On Fri, 19 Nov 2010 00:07:05 +0000, Steven D'Aprano wrote:

> On Thu, 18 Nov 2010 14:21:47 +0000, Martin Gregorie wrote:
> 
>> I use 'script' to refer to programs written in languages that don't
>> have a separate compile phase which must be run before the program can
>> be executed. IOW Python and Perl programs are scripts aloing with
>> programs written as awk, Javascript and bash scripts.
> 
> 
> You're mistaken then about Python, because it does have a separate
> compilation phase that runs before the program can be executed. Where do
> you think the .pyc files come from, and what did you think the compile()
> function did? It just happens automatically, rather than manually.
>
Notice my mention of the hash-bang line? That makes it quite clear that I 
did not mean what you're reading into "separate compile phase which must 
be run" because hash-bang means you can feed source into the run-time 
execution system, and also means that by definition the source contains 
or references everything a program needs to run and that the source code 
translation step, if there is one, is fast enough for the time it takes 
to be negligible. Those aren't necessarily the case with a separate 
compilation step. 

.pyc files are an optional extra: in a *nix environment they are not 
produced if you use a hash-bang line to execute the source file: they 
only appear if you run the source with a "python file.py" command.


-- 
martin@   | Martin Gregorie
gregorie. | Essex, UK
org       |



More information about the Python-list mailing list