Windows how does the quot;Pathquot; environment variable work?(Windows的“路径如何?环境变量工作?)
问题描述
当这个问题突然出现时,我最近将 python 添加到了我的环境变量中.当我在命令提示符中键入python"时,Windows 似乎知道要运行哪个文件.但是,我将 python 添加到这个名为Path"的环境变量中,并且从未在任何地方指定python".
当我输入python"时,我不明白 Windows 如何知道我想要什么.有人可以帮忙解决这个问题吗?
I recently added python to my environment variables when this question popped into my head. When I type "python" into command prompt, windows seems to know which file to run. However, I added python into this environment variable called "Path", and never specified "python" anywhere.
I don't understand how windows knows what I want when I type "python". Could someone help clear this up?
推荐答案
PATH 是一个环境变量,保存与当前用户和操作系统相关的值.它指定可执行程序所在的目录.因此,当您键入 python 时,窗口会从 PATH 获取其可执行文件.因此,您无需在命令行中输入文件的完整路径.
PATH is an environment variable that holds values related to current user and operating system. It specifies the directories in which executable programs are located. so when you type python window gets its executable from PATH. hence, you won't need to type the whole path to the file on command line.
这篇关于Windows的“路径"如何?环境变量工作?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:Windows的“路径"如何?环境变量工作?


基础教程推荐
- 线程时出现 msgbox 错误,GUI 块 2022-01-01
- 如何让 python 脚本监听来自另一个脚本的输入 2022-01-01
- 何时使用 os.name、sys.platform 或 platform.system? 2022-01-01
- 如何在海运重新绘制中自定义标题和y标签 2022-01-01
- 筛选NumPy数组 2022-01-01
- Dask.array.套用_沿_轴:由于额外的元素([1]),使用dask.array的每一行作为另一个函数的输入失败 2022-01-01
- 在 Python 中,如果我在一个“with"中返回.块,文件还会关闭吗? 2022-01-01
- 用于分类数据的跳跃记号标签 2022-01-01
- 使用PyInstaller后在Windows中打开可执行文件时出错 2022-01-01
- Python kivy 入口点 inflateRest2 无法定位 libpng16-16.dll 2022-01-01