gpt4 book ai didi

python - 为什么 compileall 模块不工作?

转载 作者:行者123 更新时间:2023-12-05 08:59:14 25 4
gpt4 key购买 nike

我正在测试编译 Python 代码,但是当我在一个包含测试文件的目录上运行 compileall 模块时,出于某种原因它会跳过该目录并转而编译标准库。为什么要这样做?

最佳答案

您在未指定目录的情况下运行 python -m compileall,模块正在执行 exactly what the documentation says it should : 编译 sys.path 中的每个目录。

要仅编译您当前所在的目录,请将其传递到命令行:

$ python -m compileall .

关于python - 为什么 compileall 模块不工作?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16640668/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com