Sakcee wrote: > is execution of pyc files faster than py files? since both files are > interpreted by python , is there any speedup in using one or other? > > what is difference if i type from cmd line, > python test.py vs. python test.pyc > There was no need to post your question twice.
Python compiles .py files and (if it can) saves the compiled code in a .pyc file. Next time around it can simply load the .pyc file and bypass the compilation stage. There is no difference in execution speed, in both cases the same compiled code will be executed. The main script (the one named on the command line) works slightly differently from imported modules in that a .pyc file is not automatically generated or used, so the compilation happens every time. Unless you have a very large script the difference in load time is not likely to be noticeable (and if you have a very large script then you should split it into modules). -- http://mail.python.org/mailman/listinfo/python-list