如何找到Windows上Python的安装位置? [英] How can I find where Python is installed on Windows?
本文介绍了如何找到Windows上Python的安装位置?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想在Windows上找到我的Python安装路径.例如:
I want to find out my Python installation path on Windows. For example:
C:\Python25
如何找到Python的安装位置?
How can I find where Python is installed?
推荐答案
在您的Python解释器中,键入以下命令:
In your Python interpreter, type the following commands:
>>> import os
>>> import sys
>>> os.path.dirname(sys.executable)
'C:\\Python25'
这篇关于如何找到Windows上Python的安装位置?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文