Why compile Python code?

后端 未结 10 1848
时光取名叫无心
时光取名叫无心 2020-11-27 09:37

Why would you compile a Python script? You can run them directly from the .py file and it works fine, so is there a performance advantage or something?

I also notic

10条回答
  •  误落风尘
    2020-11-27 09:43

    There's certainly a performance difference when running a compiled script. If you run normal .py scripts, the machine compiles it every time it is run and this takes time. On modern machines this is hardly noticeable but as the script grows it may become more of an issue.

提交回复
热议问题