On 04Feb2014 00:58, Igor Korot <ikoro...@gmail.com> wrote:
> I'm trying to incorporate the path in
> http://sourceforge.net/p/mysql-python/bugs/325/.
> I already modified the source code and now what I need is to produce
> the pyc code.
> 
> Running "python --help" I don't see an option to just compile the
> source into the bytecode.
> 
> So how do I produce the compiled version of the changed source?
> What I'm thinking is to compile the file update the archive and reinstall.

You want the py_compile module, parse of the stdlib.

Example:

  python -m py_compile path/to/foo.py

I use this in my personal test suite as a syntax check.

See the python docs for this module for further details.

Cheers,
-- 
Cameron Simpson <c...@zip.com.au>

A friend of mine in a compiler writing class produced a compiler with one error
message "you lied to me when you told me this was a program".
        - Pete Fenelon <p...@minster.york.ac.uk>
-- 
https://mail.python.org/mailman/listinfo/python-list

Reply via email to