在Mac上的python [英] python on Mac

查看:66
本文介绍了在Mac上的python的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚购买了一个新的macbook(os 10.4.6),我正在尝试安装

python 2.4。我在 http:所有人下载并运行了推荐的两个安装程序

//www.python.org/download/mac/
。现在我有IDLE,运行

2.4.1,但键入python在终端仍然打开2.3.5,因为它是
指向/ usr / bin / python。有没有办法在没有

空闲的情况下运行python 2.4?如果我想做一个unix风格的脚本,比如

#!/ usr / bin / python

print" hello world"

我可以把第一行放到哪一个会导致python 2.4到

解释我的代码?


非常感谢。

THN

I just purchased a new macbook (os 10.4.6), and I''m trying to install
python 2.4 on it. I downloaded and ran the two installers recommended
at http://www.python.org/download/mac/. Now I have IDLE, which runs
2.4.1, but typing "python" at a terminal still opens 2.3.5, because it
points to /usr/bin/python. Is there a way to run python 2.4 without
idle? If I want to do a unix style script, something like
#!/usr/bin/python
print "hello world"
what can I put on the first line that will cause python 2.4 to
interpret my code?

Thanks a lot.
THN

推荐答案

Thomas Nelson写道:
Thomas Nelson wrote:
我刚买了一个新的macbook(os 10.4.6) ,我正在尝试安装
python 2.4。我在 http:// www。下载并运行了推荐的两个安装程序
。 python.org/download/mac/
。现在我有IDLE,运行
2.4.1,但键入python在终端仍然打开2.3.5,因为它指向/ usr / bin / python。有没有办法在没有空闲的情况下运行python 2.4?如果我想做一个unix样式的脚本,比如
#!/ usr / bin / python
print" hello world"
我可以把第一行放到什么地方会导致python 2.4解释我的代码?

非常感谢。
THN
I just purchased a new macbook (os 10.4.6), and I''m trying to install
python 2.4 on it. I downloaded and ran the two installers recommended
at http://www.python.org/download/mac/. Now I have IDLE, which runs
2.4.1, but typing "python" at a terminal still opens 2.3.5, because it
points to /usr/bin/python. Is there a way to run python 2.4 without
idle? If I want to do a unix style script, something like
#!/usr/bin/python
print "hello world"
what can I put on the first line that will cause python 2.4 to
interpret my code?

Thanks a lot.
THN




/ usr / bin中的python是一个链接(链接)。你可以这样做:


sudo rm / usr / bin / python

sudo ln -s \

/ System /图书馆/框架/ Python.framework / Versions / 2.4 / bin / python \

/ usr / bin / python

这个愚蠢的火鸟编辑器包装词汇(我不喜欢我不知道怎么把这个完全烦人的行为关掉。显然这是因为它不可能在读者端软包装文字,烦人的NNTP老兵

无处不在 - 我们不能指望大多数

邮件阅读器中的这种难以编程的行为,因为它无法编程。这就是这样的

因为读者 - 客户端自动换行预计将存在于麻省理工学院的
1970'中。)所以如果你有一个unix大师帮助你完成最后一个命令

真的不知道发生了什么。


James


-

James Stroud

加州大学洛杉矶分校基因组学和蛋白质组学研究所

Box 951570
洛杉矶,加利福尼亚州90095

http:/ /www.jamesstroud.com/


我的Versions文件夹中没有2.4,只有2.3和当前。

其中一个安装程序是否已创建此目录?哪一个?


THN

There is no 2.4 in my Versions folder, only 2.3 and current. Should
one of the installers have created this directory? Which one?

THN


Thomas Nelson< th*@mail.utexas.edu>写道:

...
Thomas Nelson <th*@mail.utexas.edu> wrote:
...
at http://www.python.org/download/mac/ 。现在我有IDLE,它运行
at http://www.python.org/download/mac/. Now I have IDLE, which runs




Darn,该页面需要修复 - 它已经过时了! - (对不起......

请参阅< http://www.python.org/download/releases/2.4.3/>和

下载

< http://www.python.org/ftp/python/2.4.3/Universal-MacPython-2.4.3.dmg>,

你应该更开心。

Alex



Darn, that page needs to be fixed -- it''s out of date!-( Sorry...

See instead <http://www.python.org/download/releases/2.4.3/> and
download
<http://www.python.org/ftp/python/2.4.3/Universal-MacPython-2.4.3.dmg>,
you should be much happier.
Alex


这篇关于在Mac上的python的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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