compile python .py file without executing

前端 未结 6 1317
星月不相逢
星月不相逢 2020-12-04 17:55

Is there a way to compile a Python .py file from the command-line without executing it?

I am working with an application that stores its python exte

6条回答
  •  甜味超标
    2020-12-04 18:22

    The py_compile module provides a function to generate a byte-code file from a source file, and another function used when the module source file is invoked as a script.

    python -m py_compile fileA.py fileB.py fileC.py
    

提交回复
热议问题