+ 8

[PYTHON] .py and .py

What is the difference between .py and .pyc files ? And I do like to one more thing that is.. I know this that in .py has original text files but what about.pyc?

8th Oct 2020, 4:28 PM
Hardik
Hardik - avatar
4 Respuestas
+ 5
pyc files are the compiled/bytecode version of its py file. pyc generally faster for python to run
8th Oct 2020, 4:33 PM
Rei
Rei - avatar
+ 3
Rei Possible to elaborate "bytecode"? That means that extension too matters for a codes running performance?
8th Oct 2020, 4:35 PM
Hardik
Hardik - avatar
+ 3
Rei Seems to be cleared👍✌️ Again a thanks 👍
8th Oct 2020, 4:39 PM
Hardik
Hardik - avatar
+ 2
bytecode is usually a set instruction that behave exactly like the program. something like assembly language but specific to python or other interpeeted language. pyc is generated by python using your py files, simply changing extension of your source code will not make it into bytecode.
8th Oct 2020, 4:39 PM
Rei
Rei - avatar