Reputation: 34056
I know about .pyc
files (compiled .py
file) and difference between them:
difference between .py and .pyc
.py
and .pyc
files or
those benchmarks?.pyc
instead of .py
reliable ?Thanks in advance.
Upvotes: 0
Views: 564
Reputation: 652
.pyc
contains byte code which is essentially what the interpreter compiles the source code into.Generating byte code is essentially something that is done for optimisation by which way your code can be run directly without having to create an executable. This makes things faster.
Upvotes: 1
Reputation: 34056
I think when you run a .py
file, it takes few time for creating its .pyc
file.
And when you straight run .pyc
file does not need to take a time for creating .pyc
file and then runtime of .py
and .pyc
files are the same.
Upvotes: 0