在MacOS Mojave上,我安装了Sublime文本3和Python 3.7 /2.7/Anaconda。
我想确保当我运行这样的python脚本时:
john = "fun guy"
jenny = "nice lady"
jeremy = "geek"
users_input = str(input("Enter your best friend's name "))
if users_input == "john":
print("How do you know John?")
它实际上将打印结果:您怎么知道约翰?如果我输入:john
我的Python3.7位于:/usr/local/bin/python3.7
这是我在Sublime中的版本:
{
"shell_cmd": "/usr/local/bin/python3.7 ${file}",
"selector": "source.python",
"file_regex": "^(...*?):([0-9]*):?([0-9]*)",
"working_dir": "${file_path}",
}
但是出于某种奇怪的原因,它从此位置读取了它:
/usr/local/opt/python/bin/python3.7
[Finished in 0.1s]
抬起头,我已经完成
export PS1='$ '
export PATH=/usr/local/anaconda3/bin:$PATH
在我的~/.bash_profile
中。