start .pyo files with doubleclick on windows

News123 news123 at free.fr
Sun Jan 24 22:19:38 CET 2010


Hi,


I'd like to start .pyo files under windows with a double click.
(I know I can just write a .bat wrapper, but somehow it would be more
fun to start with a direct double click)


Currently this works if the file does not import any  other .pyo file.


The problem is, that a dobleclick performs a
"python.exe  myfile.pyo"

In order to import precompiled .pyo files however it seems, that
"python.exe  -OO myfile.pyo"

would be required.


Is there any trick to do this under windows?
The only trick, that I can think of is to write a small wrapper
executable, that would then call python -OO.


Wouldn't it be useful if python searched also for .pyo files when trying
to import and being invoked with

"python.exe mycode.pyo"


thanks in advance for any ideas suggestion



More information about the Python-list mailing list