Windows 中的“路径"如何处理?环境变量工作? [英] Windows how does the "Path" environment variable work?

查看:44
本文介绍了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 中的“路径"如何处理?环境变量工作?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆