简体   繁体   English

每个 IDE 都需要自己的 Python 吗?

[英]Does each IDE needs its own Python?

I have PyCharm, Visual Studio Code and Jupyter Lab installed on my PC, and the PC has Python 3.11 installed?我的电脑上安装了 PyCharm、Visual Studio Code 和 Jupyter Lab,PC 上安装了 Python 3.11?

Would someone please educate me on this topic?有人可以就这个话题教育我吗?

If I want run 3 Python programs simultaneously (each program uses its own IDE).如果我想同时运行 3 个 Python 程序(每个程序使用自己的 IDE)。 Would each IDE run faster if each IDE has its own Python program?如果每个 IDE 都有自己的 Python 程序,每个 IDE 会运行得更快吗? Right now all IDEs are using the same Python 3.11 and things are working fine.现在所有的 IDE 都使用相同的 Python 3.11 并且一切正常。 Just for my own knowledge, I am just curious of this topic.仅出于我自己的知识,我只是对这个话题感到好奇。 Thank you in advance for educating me!预先感谢您对我的教育!

You have to discriminate the two following concepts: program and process .您必须区分以下两个概念: programprocess

Program程序

A program is a list of instructions.程序是指令列表。 It's generally written on a file.它通常写在文件上。
It can be a binary text but also an ASCII text.它可以是二进制文本,也可以是 ASCII 文本。
A program does nothing .一个程序什么都不做 It is basically a static text.它基本上是一个 static 文本。

Process过程

A process is the execution of a program by your operating system.进程是由操作系统执行的程序。
A process has a dedicated memory and execution time.进程有专用的 memory 和执行时间。 Its role is to "play" your code, instruction by instruction.它的作用是逐条指令地“播放”您的代码。


In your example, python.exe is a program.在您的示例中, python.exe是一个程序。

When you execute it, your operating system will create a dedicated process.当您执行它时,您的操作系统将创建一个专用进程。

So, when you run several IDEs, you simply run several process of your same program.因此,当您运行多个 IDE 时,您只需运行同一程序的多个进程。
Thus, there is absolutely no loss in terms of performance.因此,在性能方面绝对没有损失。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM