Python is a compiler operation
Although Python is an interpreted language, but in fact, Python source code to be compiled, and then to run.
Similar with the Java language, Python source code compiler are byte code, run by the Python virtual machine.
On this point, we can verify:
#!/usr/bin/python print "position1" 1_syntax_error_identifier print "position2"
Save it for program.py, and then run it in the shell window:
root@dell:~$ ./program.py File "./program.py", line 4 1_syntax_error_identifier ^ SyntaxError: invalid syntax root@dell:~$
From here we can see that, if Python is pure interpretation of the operation, it should output Position1.
If it is compiled to run it, should first find syntax errors in source code, this is the case of a show case.
Posted by Scott at November 16, 2013 - 10:49 PM