python pyc or pyo files

M

micklee74

hi

any good websites or articles that describes about pyc or pyo files ,
how they are generated and what's the difference between them and
Java's bytecode??
thanks
 
F

Fredrik Lundh

any good websites or articles that describes about pyc or pyo files ,
how they are generated and what's the difference between them and
Java's bytecode??

they're described in the Python tutorial:

http://docs.python.org/tut/node8.html#SECTION008120000000000000000

the difference between PYC files and java byte code is that PYC files
contain Python byte code, not Java code, and that Python generates
them on the fly, without any need for an explicity compile step.

if you want Java byte code for your Python programs, use Jython.

http://www.jython.org/

</F>
 
M

micklee74

thanks !
can i ask again...
I have two scripts , A.py and B.py
In B.py, i have an import statement to import A.py
When i executed B.py, i saw a A.pyc in the same directory, but not
B.pyc ....
This is an expected behaviour right? why is B.pyc not generated?

thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top