Need compile python code

mistral polychrom at softhome.net
Sat Sep 23 15:24:58 EDT 2006


MonkeeSage wrote:
> mistral wrote:
> > this not work for me, show compilation error.  Is there simple way
> > compile pythone file? its absolutely unclear with command line. Just
> > show me exact command I need run(from python interactive shell?)
>
> OK...
>
> # cd to where the file.py is
> $ cd /some/dir
>
> # start python interactively, enable optimized compiling
> $ python -O
> ...
>
> # import your file.py -- if this doesn't work then
> # your file has errors and will not compile --
> # if it works then your file is now compiled --
> # file.pyo should now exist with file.py
> >>> import file
>
> # you can also do it explicitly --
> # import the compiler
> >>> import py_compile
> >>> py_compiler.compile('file.py')
>
> If that still doesn't work, show us the error, or we can't help you
> very easily.
>
> Regards,
> Jordan
---

No, something is wrong there. what I need is just compile one python
file which will generate html page, with parameters:
"exec" "python" "-O" "$0" "$@"

 just need simple way do this(script is correct), i will not set any
patches anywhere, can i do this wrom normal GUI?




More information about the Python-list mailing list