compile python .py file without executing

前端 未结 6 1308
星月不相逢
星月不相逢 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:08

    Yes, there is module compileall. Here's an example that compiles all the .py files in a directory (but not sub-directories):

    python -m compileall -l myDirectory
    

提交回复
热议问题