On 28/01/13 18:26, Gayathri S wrote:
Hi all..!
            wanna know how to compile python script in python command line,
and is there any need for setting path for python like JAVA? whats the
difference between .py file and .pyc file?


Python is a byte-code compiled language, like Java many years ago. Normally to 
compile a python module, you just import it from within Python.

That is not very convenient for scripts, so from the shell (bash, command.com, 
cmd.exe, or similar) you can run

python -m compileall NAME NAME ...

to compile scripts.


You do not necessarily need to set the PYTHONPATH, but you can if you need to.

.py files are source code. .pyc are compiled byte code. .pyo are compiled byte 
code with optimization turned on. Don't get too excited, the standard Python 
optimization doesn't do very much.



--
Steven
_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor

Reply via email to