Hello everyone ..

Im new in python and i have a question !

How to compile myfile.py to myfile.pyo ?

Can you give me an example script coz i dont know were to put python -0 to compile it into pyo !

Thanks a lot ..

Recommended Answers

All 5 Replies

im using pys60 and i want to compile myfile.py to myfile.pyo ! Is there a example code on how to compile ? coz i dont have any idea ..

I am not familliar with pys60... I suppose you could manually force a compile.

try making a script that is in the same directory called compileme.py:

import py_compile

save, and run it.

This may end up with a .pyc file, though (it shouldnt be any different, I believe)... and that's also assuming py_compile is included with your distribution of python...

Look under PYTHONOPTIMIZE in the Python manual.

pyo, is os dependent i think, and there is no way to compile a py to pyo on the phone. you can compile or decompile py/pyc files using many apps out there as symbian packages (e.g. BestDeCompiler.sis).
if you make a pyo on pc from a pys60 script, i think it wont run on your phone.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.