Question:

Differentiate between “*.py” file nad “*.pyc” file?

Answer:

Both .py and .pyc files holds the byte code. “.pyc” is a compiled version of Python file. This file is automatically generated by Python to improve performance. The .pyc file is having byte code which is platform independent and can be executed on any operating system that supports .pyc format.
Note: there is no difference in speed when program is read from .pyc or .py file; the only difference is the load time.


Keywords:

© 2017 QuizBucket.org