問題描述
當這個問題突然出現時,我最近將 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的“路徑"如何?環境變量工作?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!