Cannot run a specific .pyc file

前端 未结 2 1472
借酒劲吻你
借酒劲吻你 2021-02-09 06:04

After compiling a in unix-working python file using

import py_compile
py_compile.compile(\'server.py\')

I get the .pyc file in the same directo

2条回答
  •  广开言路
    2021-02-09 06:49

    Run the first command to generate the server.pyc file. Then the second command can run the server.pyc module. The -c option and -m option are described in the python docs.

    python -c "import server"
    python -m server
    

提交回复
热议问题